{"record":{"id":"60be3d68cd65b8f7","repo":"JuliusBrussee/caveman","slug":"cave-claude-tool-schema-unsupported-item-name","errorCode":null,"errorMessage":"cave_claude_tool_schema_unsupported:${item.name}","messagePattern":"cave_claude_tool_schema_unsupported:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/agent/src/claude-runtime.ts","lineNumber":151,"sourceCode":"    // lane can only ever be an unlocked run: a missing gateway degrades to\n    // observe-only rather than blocking a first response.\n    const { useGateway } = await resolveCaveRoute(gatewayURL, options, false);\n    const instructions = assembleSystemPrompt(definition, lowered);\n    const runID = crypto.randomUUID();\n    const sessionID = `claude-${definition.id}-${runID}`;\n    const prefixSHA256 = sha256(stableStringify({\n      instructions,\n      tools: definition.tools.map((item) => ({\n        name: item.name,\n        description: item.description,\n        input: item.input,\n      })),\n    }));\n    const toolNames = new Set<string>();\n    const mcpTools = definition.tools.map((item) => {\n      const converted = z.fromJSONSchema(item.input as Record<string, unknown>);\n      if (!(converted instanceof z.ZodObject)) {\n        throw new Error(`cave_claude_tool_schema_unsupported:${item.name}`);\n      }\n      const execute = createHarnessToolExecutor({\n        definition,\n        tool: item,\n        sandbox,\n        ...(options.sandboxProfile === undefined ? {} : { sandboxProfile: options.sandboxProfile }),\n        ...(options.engineBin === undefined ? {} : { engineBin: options.engineBin }),\n      });\n      const wireName = `mcp__caveman_agent__${item.name}`;\n      toolNames.add(wireName);\n      return claudeTool(\n        item.name,\n        item.description,\n        converted.shape,\n        async (args) => {\n          const value = await execute(args, controller.signal);\n          if (!isRecord(value) || !Array.isArray(value.content)) {\n            throw new Error(`cave_claude_tool_result_invalid:${item.name}`);","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/packages/agent/src/claude-runtime.ts#L133-L169","documentation":"Tool-schema guard in runClaudeAgentWithOptions: while converting definition.tools to Claude SDK tool schemas, a tool's input schema (Standard Schema) uses a converter shape this adapter cannot handle; the tool name is embedded in the message.","triggerScenarios":"Thrown at packages/agent/src/claude-runtime.ts:151 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a plain JSON Schema (or a supported Standard Schema validator) for the named tool's input","Simplify the tool's input schema to standard JSON Schema types","Update the adapter's schema converter to support the schema library in use"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}