mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
fix: update google/genai to v1.9.0 and switch to parametersJsonSchema for MCP related tools (#4176)
Co-authored-by: Jack Wotherspoon <jackwoth@google.com>
This commit is contained in:
@@ -18,8 +18,9 @@ import {
|
||||
import { parse } from 'shell-quote';
|
||||
import { MCPServerConfig } from '../config/config.js';
|
||||
import { DiscoveredMCPTool } from './mcp-tool.js';
|
||||
import { FunctionDeclaration, Type, mcpToTool } from '@google/genai';
|
||||
import { sanitizeParameters, ToolRegistry } from './tool-registry.js';
|
||||
|
||||
import { FunctionDeclaration, mcpToTool } from '@google/genai';
|
||||
import { ToolRegistry } from './tool-registry.js';
|
||||
import {
|
||||
ActiveFileNotificationSchema,
|
||||
IDE_SERVER_NAME,
|
||||
@@ -275,15 +276,13 @@ export async function discoverTools(
|
||||
|
||||
const toolNameForModel = generateValidName(funcDecl, mcpServerName);
|
||||
|
||||
sanitizeParameters(funcDecl.parameters);
|
||||
|
||||
discoveredTools.push(
|
||||
new DiscoveredMCPTool(
|
||||
mcpCallableTool,
|
||||
mcpServerName,
|
||||
toolNameForModel,
|
||||
funcDecl.description ?? '',
|
||||
funcDecl.parameters ?? { type: Type.OBJECT, properties: {} },
|
||||
funcDecl.parametersJsonSchema ?? { type: 'object', properties: {} },
|
||||
funcDecl.name!,
|
||||
mcpServerConfig.timeout ?? MCP_DEFAULT_TIMEOUT_MSEC,
|
||||
mcpServerConfig.trust,
|
||||
|
||||
Reference in New Issue
Block a user