refactor: Update MCP tool discovery to use @google/genai - Also fixes JSON schema issues. (#682)

This commit is contained in:
N. Taylor Mullen
2025-06-02 13:39:25 -07:00
committed by GitHub
parent 0795e55f0e
commit 58597c29d3
7 changed files with 744 additions and 812 deletions

View File

@@ -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.
*/