continue-custom/core/tools/mcpToolName.ts
2025-06-04 16:52:14 -07:00

9 lines
305 B
TypeScript

import { MCPServerStatus, MCPTool } from "..";
export function getMCPToolName(server: MCPServerStatus, tool: MCPTool) {
const serverPrefix = server.name.split(" ").join("_").toLowerCase();
if (tool.name.startsWith(serverPrefix)) {
return tool.name;
}
return `${serverPrefix}_${tool.name}`;
}