mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
refactor: Update MCP tool discovery to use @google/genai - Also fixes JSON schema issues. (#682)
This commit is contained in:
@@ -155,7 +155,7 @@ export class ToolRegistry {
|
||||
}
|
||||
}
|
||||
// discover tools using MCP servers, if configured
|
||||
await discoverMcpTools(this.config, this);
|
||||
await discoverMcpTools(this.config);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,6 +179,19 @@ export class ToolRegistry {
|
||||
return Array.from(this.tools.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of tools registered from a specific MCP server.
|
||||
*/
|
||||
getToolsByServer(serverName: string): Tool[] {
|
||||
const serverTools: Tool[] = [];
|
||||
for (const tool of this.tools.values()) {
|
||||
if ((tool as DiscoveredMCPTool)?.serverName === serverName) {
|
||||
serverTools.push(tool);
|
||||
}
|
||||
}
|
||||
return serverTools;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the definition of a specific tool.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user