{"record":{"id":"11d0def6247f2a1e","repo":"CherryHQ/cherry-studio","slug":"methodnotfound","errorCode":"MethodNotFound","errorMessage":"Unknown tool: ${toolName}","messagePattern":"Unknown tool: (.+?)","errorType":"error_code","errorClass":"McpError","httpStatus":null,"severity":"error","filePath":"src/main/ai/mcp/servers/assistant.ts","lineNumber":272,"sourceCode":"\n    this.mcpServer.server.setRequestHandler(CallToolRequestSchema, async (request) => {\n      const toolName = request.params.name\n      const args = request.params.arguments ?? {}\n\n      try {\n        switch (toolName) {\n          case 'navigate':\n            return await this.navigate(args as Record<string, string | Record<string, string> | undefined>)\n          case 'diagnose':\n            return await this.diagnose(args)\n          case 'product_info':\n            return await this.productInfo(args)\n          case 'apply_setting':\n            return await this.applySetting(args as Record<string, string | undefined>)\n          case 'create_agent':\n            return await this.createAgent(args as Record<string, string | undefined>)\n          default:\n            throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${toolName}`)\n        }\n      } catch (error) {\n        const message = error instanceof Error ? error.message : String(error)\n        logger.error(`Tool error: ${toolName}`, { error: message })\n        return {\n          content: [{ type: 'text' as const, text: `Error: ${message}` }],\n          isError: true\n        }\n      }\n    })\n  }\n\n  private readProductManifest(): Record<string, unknown> {\n    const manifestPath = application.getPath('feature.agents.assistant.manifest.file')\n    let rawManifest: string\n    try {\n      rawManifest = fs.readFileSync(manifestPath, 'utf-8')\n    } catch {","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/mcp/servers/assistant.ts#L254-L290","documentation":"The AssistantServer CallToolRequest handler knows five tools: navigate, diagnose, product_info, apply_setting, create_agent. Any other tool name hits the default branch and throws McpError with ErrorCode.MethodNotFound. This is the protocol-correct rejection of unsupported tools.","triggerScenarios":"An MCP client sends a CallToolRequest with a name not among the five advertised tools. Common with stale client tool caches, misrouted requests, or an LLM hallucinating a tool name.","commonSituations":"Client/server version skew where the client believes a removed tool still exists; a generic MCP probe; a bug in the router sending the call to the assistant server instead of the intended one.","solutions":["Call ListTools to get the current advertised set before invoking.","Confirm you are targeting the 'assistant' server.","Update the client to the server's tool surface."],"exampleFix":"// before\nawait assistant.callTool({ name: 'translate', arguments: {...} })\n\n// after\nawait assistant.callTool({ name: 'diagnose', arguments: { action: 'info' } })","handlingStrategy":"validation","validationCode":"const ASSISTANT_TOOLS = new Set(['navigate', 'diagnose', 'product_info', 'apply_setting', 'create_agent'])\n// Client-side:\nif (!ASSISTANT_TOOLS.has(toolName)) {\n  throw new Error(`'${toolName}' is not offered by the assistant server`)\n}","typeGuard":"function isAssistantTool(name: string): boolean {\n  return ['navigate', 'diagnose', 'product_info', 'apply_setting', 'create_agent'].includes(name)\n}","tryCatchPattern":null,"preventionTips":["Call ListTools before invoking any tool on the assistant server.","Pin client/server versions together.","Ensure your MCP router dispatches to the correct server by name."],"tags":["mcp","protocol-error","method-not-found","assistant"],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}