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

Function selectToolId

apps/sim/serializer/index.ts:412–423  ·  view source on GitHub ↗
(blockConfig: any, params: Record<string, any>)

Source from the content-addressed store, hash-verified

410 * Select the tool id for a block given its resolved params.
411 */
412export function selectToolId(blockConfig: any, params: Record<string, any>): string {
413 try {
414 return blockConfig.tools.config?.tool
415 ? blockConfig.tools.config.tool(params)
416 : blockConfig.tools.access[0]
417 } catch (error) {
418 logger.warn('Tool selection failed during serialization, using default:', {
419 error: toError(error).message,
420 })
421 return blockConfig.tools.access[0]
422 }
423}
424
425/**
426 * Resolve a block's UI sub-block state into the flat `params` map the runtime

Callers 2

serializeBlockMethod · 0.85
collectBlockFieldIssuesFunction · 0.85

Calls 2

toErrorFunction · 0.90
warnMethod · 0.65

Tested by

no test coverage detected