MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveToolId

Function resolveToolId

apps/sim/lib/search/tool-operations.ts:94–110  ·  view source on GitHub ↗

* Resolves the tool ID for a given operation using the block's tool config. * Falls back to checking tools.access if no config.tool function exists.

(block: BlockConfig, operationId: string)

Source from the content-addressed store, hash-verified

92 * Falls back to checking tools.access if no config.tool function exists.
93 */
94function resolveToolId(block: BlockConfig, operationId: string): string | null {
95 if (!block.tools) return null
96
97 if (block.tools.config?.tool) {
98 try {
99 return block.tools.config.tool({ operation: operationId })
100 } catch {
101 return null
102 }
103 }
104
105 if (block.tools.access?.length === 1) {
106 return block.tools.access[0]
107 }
108
109 return null
110}
111
112/**
113 * Builds an index of all tool operations from the block registry.

Callers 1

buildToolOperationsIndexFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected