fix multiple mcp servers
This commit is contained in:
parent
feb9dee4b1
commit
324040032a
|
@ -619,6 +619,7 @@ describe('DiscoveredMCPTool', () => {
|
||||||
toolName,
|
toolName,
|
||||||
toolDescription,
|
toolDescription,
|
||||||
toolInputSchema,
|
toolInputSchema,
|
||||||
|
toolName,
|
||||||
);
|
);
|
||||||
expect(tool.name).toBe(toolName);
|
expect(tool.name).toBe(toolName);
|
||||||
expect(tool.schema.description).toContain(toolDescription);
|
expect(tool.schema.description).toContain(toolDescription);
|
||||||
|
@ -634,6 +635,7 @@ describe('DiscoveredMCPTool', () => {
|
||||||
toolName,
|
toolName,
|
||||||
toolDescription,
|
toolDescription,
|
||||||
toolInputSchema,
|
toolInputSchema,
|
||||||
|
toolName,
|
||||||
);
|
);
|
||||||
const params = { data: 'test_data' };
|
const params = { data: 'test_data' };
|
||||||
const mcpResult = { success: true, value: 'processed' };
|
const mcpResult = { success: true, value: 'processed' };
|
||||||
|
|
|
@ -99,6 +99,7 @@ export class DiscoveredMCPTool extends BaseTool<ToolParams, ToolResult> {
|
||||||
readonly name: string,
|
readonly name: string,
|
||||||
readonly description: string,
|
readonly description: string,
|
||||||
readonly parameterSchema: Record<string, unknown>,
|
readonly parameterSchema: Record<string, unknown>,
|
||||||
|
readonly serverToolName: string,
|
||||||
) {
|
) {
|
||||||
description += `
|
description += `
|
||||||
|
|
||||||
|
@ -112,7 +113,7 @@ Returns the MCP server response as a json string.
|
||||||
|
|
||||||
async execute(params: ToolParams): Promise<ToolResult> {
|
async execute(params: ToolParams): Promise<ToolResult> {
|
||||||
const result = await this.mcpClient.callTool({
|
const result = await this.mcpClient.callTool({
|
||||||
name: this.name,
|
name: this.serverToolName,
|
||||||
arguments: params,
|
arguments: params,
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
|
@ -251,6 +252,7 @@ export class ToolRegistry {
|
||||||
: tool.name,
|
: tool.name,
|
||||||
tool.description ?? '',
|
tool.description ?? '',
|
||||||
tool.inputSchema,
|
tool.inputSchema,
|
||||||
|
tool.name,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue