{"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":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/mcp/index.ts","lineNumber":176,"sourceCode":"                \"Array of items to get the add command for prefixed with the registry name (e.g., ['@shadcn/button', '@shadcn/card'])\"\n              ),\n          })\n        ),\n      },\n      {\n        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  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":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/mcp/index.ts#L158-L194","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":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}