{"record":{"id":"2e7f31743760607f","repo":"CherryHQ/cherry-studio","slug":"methodnotfound-2e7f31","errorCode":"MethodNotFound","errorMessage":"Unknown tool: ${toolName}","messagePattern":"Unknown tool: (.+?)","errorType":"error_code","errorClass":"McpError","httpStatus":null,"severity":"warning","filePath":"src/main/ai/mcp/servers/cherryAutonomyTools.ts","lineNumber":323,"sourceCode":"            case 'update_channel':\n              return await this.configUpdateChannel(args)\n            case 'remove_channel':\n              return await this.configRemoveChannel(args)\n            case 'reconnect_channel':\n              return await this.configReconnectChannel(args)\n            case 'complete_bootstrap':\n              return this.configCompleteBootstrap()\n            case 'reset_bootstrap':\n              return this.configResetBootstrap()\n            default:\n              throw new McpError(\n                ErrorCode.InvalidParams,\n                `Unknown action \"${action}\", expected status/rename/add_channel/update_channel/remove_channel/reconnect_channel/complete_bootstrap/reset_bootstrap`\n              )\n          }\n        }\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}`, { agentId: this.agentId, error: message })\n      return {\n        content: [{ type: 'text' as const, text: `Error: ${message}` }],\n        isError: true\n      }\n    }\n  }\n\n  private async addJob(args: Record<string, unknown>) {\n    const name = args.name as string | undefined\n    const message = args.message as string | undefined\n    const cronExpr = args.cron as string | undefined\n    const every = args.every as string | undefined\n    const at = args.at as string | undefined\n    const rawChannelIds = args.channel_ids as string[] | undefined","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/mcp/servers/cherryAutonomyTools.ts#L305-L341","documentation":"The outer switch in callTool dispatches over CRON_TOOL_NAME, NOTIFY_TOOL_NAME, CONFIG_TOOL_NAME; any other toolName falls to default and throws McpError(ErrorCode.MethodNotFound, 'Unknown tool: ${toolName}'). This is the autonomy server's equivalent of a 404 for tool routing.","triggerScenarios":"Calling the cherry-tools autonomy server with a tool name that is not cron, notify, or config — a typo, a hallucinated name, or a tool belonging to a different server.","commonSituations":"Agent assumes a tool exists on this server (e.g. 'search', 'email'); casing mismatch; client routed the call to the wrong server; tool was renamed in an upgrade.","solutions":["Call ListTools on the cherry-tools server and only invoke names it advertises (cron/notify/config).","Verify the tool name spelling and casing.","If the tool belongs elsewhere (e.g. brave search, browser), route the call to that server."],"exampleFix":"// before\nserver.callTool({ name: 'schedule', arguments: {...} })\n\n// after — use the registered cron tool name\nserver.callTool({ name: CRON_TOOL_NAME, arguments: { action: 'add', ... } })","handlingStrategy":"validation","validationCode":"const AUTONOMY_TOOLS = new Set([CRON_TOOL_NAME, NOTIFY_TOOL_NAME, CONFIG_TOOL_NAME])\nfunction validateAutonomyTool(name: unknown) {\n  if (typeof name !== 'string' || !AUTONOMY_TOOLS.has(name)) {\n    throw new Error(`Unknown tool: ${name}. This server exposes: ${[...AUTONOMITY_TOOLS].join(', ')}`)\n  }\n}","typeGuard":"function isAutonomyTool(v: unknown): boolean {\n  return typeof v === 'string' && [CRON_TOOL_NAME, NOTIFY_TOOL_NAME, CONFIG_TOOL_NAME].includes(v)\n}","tryCatchPattern":"if (!isAutonomyTool(name)) {\n  return { content: [{ type: 'text', text: `Unknown tool on autonomy server: ${name}` }], isError: true }\n}","preventionTips":["Call ListTools to discover the exact tool names.","Route tools to the correct server (brave/browser live elsewhere).","Verify casing."],"tags":["validation","mcp","routing","cherry-autonomy"],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}