(name: string)
| 120 | * Tool names should be lowercase, alphanumeric with underscores. |
| 121 | */ |
| 122 | export 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. |
no test coverage detected