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

Function validateToolReference

apps/sim/lib/workflows/sanitization/validation.ts:299–315  ·  view source on GitHub ↗
(
  toolId: string | undefined,
  blockType: string,
  blockName?: string
)

Source from the content-addressed store, hash-verified

297 * Returns null if valid, error message if invalid
298 */
299export function validateToolReference(
300 toolId: string | undefined,
301 blockType: string,
302 blockName?: string
303): string | null {
304 if (!toolId) return null
305
306 if (!isCustomTool(toolId) && !isMcpTool(toolId)) {
307 // For built-in tools, verify they exist
308 const tool = getTool(toolId)
309 if (!tool) {
310 return `Block ${blockName || 'unknown'} (${blockType}): references non-existent tool '${toolId}'`
311 }
312 }
313
314 return null
315}

Callers 1

validateWorkflowStateFunction · 0.85

Calls 3

isCustomToolFunction · 0.90
isMcpToolFunction · 0.90
getToolFunction · 0.90

Tested by

no test coverage detected