{"record":{"id":"c4bb846898c8cb90","repo":"shadcn-ui/ui","slug":"no-tool-arguments-provided","errorCode":null,"errorMessage":"No tool arguments provided.","messagePattern":"No tool arguments provided\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/mcp/index.ts","lineNumber":198,"sourceCode":"        name: \"get_audit_checklist\",\n        description:\n          \"After creating new components or generating new code files, use this tool for a quick checklist to verify that everything is working as expected. Make sure to run the tool after all required steps have been completed.\",\n        inputSchema: zodToJsonSchema(z.object({})),\n      },\n    ],\n  }\n})\n\nserver.setRequestHandler(CallToolRequestSchema, async (request) =>\n  withRegistryContext(() => handleCallTool(request), { onGitHubAuthNotice })\n)\n\nasync function handleCallTool(request: {\n  params: { name: string; arguments?: Record<string, unknown> }\n}) {\n  try {\n    if (!request.params.arguments) {\n      throw new Error(\"No tool arguments provided.\")\n    }\n\n    switch (request.params.name) {\n      case \"get_project_registries\": {\n        const config = await getMcpConfig(process.cwd())\n\n        if (!config?.registries) {\n          return {\n            content: [\n              {\n                type: \"text\",\n                text: dedent`No components.json found or no registries configured.\n\n                To fix this:\n                1. Use the \\`init\\` command to create a components.json file\n                2. Or manually create components.json with a registries section`,\n              },\n            ],","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/shadcn-ui/ui/blob/683a5a9b370acdb7785a0529434e6a3b8c7e0441/packages/shadcn/src/mcp/index.ts#L180-L216","documentation":"The MCP CallTool handler requires request.params.arguments to be present — even an empty object for no-arg tools. Some clients send null/undefined for tools taking no arguments; this guard rejects that before dispatching into the tool switch.","triggerScenarios":"An MCP client (Claude Code, Cursor, VS Code, Codex, OpenCode) calls a shadcn MCP tool but omits the arguments field or sends null — common for get_audit_checklist whose schema is z.object({}).","commonSituations":"Client bug, older client spec version, a client that treats 'no parameters' as 'no arguments key' rather than arguments:{}.","solutions":["Update the MCP client to always send arguments ({} for no-arg tools).","If you control the client, ensure params.arguments is an object before sending the request."],"exampleFix":"// before (client call)\nclient.callTool({ name: 'get_audit_checklist', arguments: null })\n// after\nclient.callTool({ name: 'get_audit_checklist', arguments: {} })","handlingStrategy":"validation","validationCode":"// On the client side: always pass an arguments object, even for no-arg tools.\nawait client.callTool({\n  name: \"get_audit_checklist\",\n  arguments: {},\n})","typeGuard":"type CallToolRequest = { params: { name: string; arguments?: Record<string, unknown> | null } }\n\nfunction hasMcpArgs(req: CallToolRequest): req is { params: { name: string; arguments: Record<string, unknown> } } {\n  return req?.params?.arguments != null && typeof req.params.arguments === \"object\"\n}","tryCatchPattern":null,"preventionTips":["Always pass an arguments object (even {}), never null/undefined, in MCP calls.","Keep the MCP client library up to date with the protocol spec."],"tags":["mcp","protocol","validation"],"backgroundTag":null,"analyzedSha":"683a5a9b370acdb7785a0529434e6a3b8c7e0441","analyzedAt":"2026-08-27T14:12:43.753Z","contentChangedAt":"2026-08-27T14:12:43.753Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}