diff options
| author | olcan <[email protected]> | 2025-05-17 14:13:27 -0700 |
|---|---|---|
| committer | Olcan <[email protected]> | 2025-05-17 14:14:59 -0700 |
| commit | 324040032aea4e859882390c9997aadb9e21193d (patch) | |
| tree | f63d3e2f2a37a127ae423c656901d33f13337337 | |
| parent | feb9dee4b17e53ca14506fce6824924586fc59fa (diff) | |
fix multiple mcp servers
| -rw-r--r-- | packages/server/src/tools/tool-registry.test.ts | 2 | ||||
| -rw-r--r-- | packages/server/src/tools/tool-registry.ts | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/packages/server/src/tools/tool-registry.test.ts b/packages/server/src/tools/tool-registry.test.ts index d43eaff9..cf699377 100644 --- a/packages/server/src/tools/tool-registry.test.ts +++ b/packages/server/src/tools/tool-registry.test.ts @@ -619,6 +619,7 @@ describe('DiscoveredMCPTool', () => { toolName, toolDescription, toolInputSchema, + toolName, ); expect(tool.name).toBe(toolName); expect(tool.schema.description).toContain(toolDescription); @@ -634,6 +635,7 @@ describe('DiscoveredMCPTool', () => { toolName, toolDescription, toolInputSchema, + toolName, ); const params = { data: 'test_data' }; const mcpResult = { success: true, value: 'processed' }; diff --git a/packages/server/src/tools/tool-registry.ts b/packages/server/src/tools/tool-registry.ts index 7bc04432..d0bdfba0 100644 --- a/packages/server/src/tools/tool-registry.ts +++ b/packages/server/src/tools/tool-registry.ts @@ -99,6 +99,7 @@ export class DiscoveredMCPTool extends BaseTool<ToolParams, ToolResult> { readonly name: string, readonly description: string, readonly parameterSchema: Record<string, unknown>, + readonly serverToolName: string, ) { description += ` @@ -112,7 +113,7 @@ Returns the MCP server response as a json string. async execute(params: ToolParams): Promise<ToolResult> { const result = await this.mcpClient.callTool({ - name: this.name, + name: this.serverToolName, arguments: params, }); return { @@ -251,6 +252,7 @@ export class ToolRegistry { : tool.name, tool.description ?? '', tool.inputSchema, + tool.name, ), ); } |
