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

Function sanitizeToolName

apps/sim/lib/mcp/workflow-tool-schema.ts:122–132  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

120 * Tool names should be lowercase, alphanumeric with underscores.
121 */
122export function sanitizeToolName(name: string): string {
123 return (
124 name
125 .toLowerCase()
126 .replace(/[^a-z0-9\s_-]/g, '')
127 .replace(/[\s-]+/g, '_')
128 .replace(/_+/g, '_')
129 .replace(/^_|_$/g, '')
130 .substring(0, 64) || 'workflow_tool'
131 )
132}
133
134/**
135 * Generate MCP tool input schema from InputFormatField array.

Callers 5

executeDeployMcpFunction · 0.90
prepareWorkflowMcpToolFunction · 0.90
McpDeployFunction · 0.90
generateToolDefinitionFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected