(toolId: string)
| 187 | * Parse MCP tool ID to extract server ID and tool name |
| 188 | */ |
| 189 | export function parseMcpToolId(toolId: string): { serverId: string; toolName: string } { |
| 190 | const parts = toolId.split('-') |
| 191 | if (parts.length < 3 || parts[0] !== 'mcp') { |
| 192 | throw new Error(`Invalid MCP tool ID format: ${toolId}. Expected: mcp-serverId-toolName`) |
| 193 | } |
| 194 | |
| 195 | const serverId = `${parts[0]}-${parts[1]}` |
| 196 | const toolName = parts.slice(2).join('-') |
| 197 | |
| 198 | return { serverId, toolName } |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Generate a deterministic MCP server ID based on workspace and URL. |
no test coverage detected