{"record":{"id":"8032f08a09e73b8e","repo":"shadcn-ui/ui","slug":"tool-request-params-name-not-found","errorCode":null,"errorMessage":"Tool ${request.params.name} not found","messagePattern":"Tool (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/mcp/index.ts","lineNumber":524,"sourceCode":"              type: \"text\",\n              text: dedent`## Component Audit Checklist\n\n              After adding or generating components, check the following common issues:\n\n              - [ ] Ensure imports are correct i.e named vs default imports\n              - [ ] If using next/image, ensure images.remotePatterns next.config.js is configured correctly.\n              - [ ] Ensure all dependencies are installed.\n              - [ ] Check for linting errors or warnings\n              - [ ] Check for TypeScript errors\n              - [ ] Use the Playwright MCP if available.\n              `,\n            },\n          ],\n        }\n      }\n\n      default:\n        throw new Error(`Tool ${request.params.name} not found`)\n    }\n  } catch (error) {\n    if (error instanceof z.ZodError) {\n      return {\n        content: [\n          {\n            type: \"text\",\n            text: dedent`Invalid input parameters:\n              ${error.errors\n                .map((e) => `- ${e.path.join(\".\")}: ${e.message}`)\n                .join(\"\\n\")}\n              `,\n          },\n        ],\n        isError: true,\n      }\n    }\n","sourceCodeStart":506,"sourceCodeEnd":542,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/mcp/index.ts#L506-L542","documentation":"The CallTool switch has no case matching request.params.name — the tool was never registered (or the client is invoking a stale/hallucinated name). Registered tools in this version: get_project_registries, search_items_in_registries, get_add_command_for_items, get_audit_checklist.","triggerScenarios":"MCP client calls a tool name that is not in the registered list — e.g., a name from an older shadcn version, or an AI client hallucinating a tool name.","commonSituations":"Client cached an old tool list from a previous shadcn version, AI client fabricated a tool name, typo in a hand-written client integration.","solutions":["Refresh the client's tool list (restart/reconnect the MCP server).","Use only the supported tool names for this shadcn version.","Upgrade both client and shadcn to matching, current versions."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const SUPPORTED_TOOLS = new Set([\n  \"get_project_registries\",\n  \"search_items_in_registries\",\n  \"get_add_command_for_items\",\n  \"get_audit_checklist\",\n])\n\nfunction assertKnownTool(name: string) {\n  if (!SUPPORTED_TOOLS.has(name)) {\n    throw new Error(`Unknown tool: ${name}. Supported: ${[...SUPPORTED_TOOLS].join(\", \")}`)\n  }\n}","typeGuard":"function isKnownMcpTool(name: string, known: Set<string>): boolean {\n  return known.has(name)\n}","tryCatchPattern":null,"preventionTips":["Re-fetch the tool list on client startup rather than caching across versions.","Avoid hardcoding tool names in client integrations."],"tags":["mcp","protocol","validation"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}