mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Add and improve JSDoc comments for core tool methods (#3128)
This commit is contained in:
@@ -162,6 +162,16 @@ export async function discoverMcpTools(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects to an MCP server and discovers available tools, registering them with the tool registry.
|
||||
* This function handles the complete lifecycle of connecting to a server, discovering tools,
|
||||
* and cleaning up resources if no tools are found.
|
||||
*
|
||||
* @param mcpServerName The name identifier for this MCP server
|
||||
* @param mcpServerConfig Configuration object containing connection details
|
||||
* @param toolRegistry The registry to register discovered tools with
|
||||
* @returns Promise that resolves when discovery is complete
|
||||
*/
|
||||
async function connectAndDiscover(
|
||||
mcpServerName: string,
|
||||
mcpServerConfig: MCPServerConfig,
|
||||
@@ -375,6 +385,13 @@ async function connectAndDiscover(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitizes a JSON schema object to ensure compatibility with Vertex AI.
|
||||
* This function recursively processes the schema to remove problematic properties
|
||||
* that can cause issues with the Gemini API.
|
||||
*
|
||||
* @param schema The JSON schema object to sanitize (modified in-place)
|
||||
*/
|
||||
export function sanitizeParameters(schema?: Schema) {
|
||||
if (!schema) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user