JuliusBrussee/caveman · error · Error

cave_claude_tool_schema_unsupported

Error message

cave_claude_tool_schema_unsupported:${item.name}

What it means

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.

Solutions

  1. Provide a plain JSON Schema (or a supported Standard Schema validator) for the named tool's input
  2. Simplify the tool's input schema to standard JSON Schema types
  3. Update the adapter's schema converter to support the schema library in use
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/agent/src/claude-runtime.ts:151 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/60be3d68cd65b8f7. Report an issue: GitHub.

Appendix: source

Thrown at packages/agent/src/claude-runtime.ts:151

    // lane can only ever be an unlocked run: a missing gateway degrades to
    // observe-only rather than blocking a first response.
    const { useGateway } = await resolveCaveRoute(gatewayURL, options, false);
    const instructions = assembleSystemPrompt(definition, lowered);
    const runID = crypto.randomUUID();
    const sessionID = `claude-${definition.id}-${runID}`;
    const prefixSHA256 = sha256(stableStringify({
      instructions,
      tools: definition.tools.map((item) => ({
        name: item.name,
        description: item.description,
        input: item.input,
      })),
    }));
    const toolNames = new Set<string>();
    const mcpTools = definition.tools.map((item) => {
      const converted = z.fromJSONSchema(item.input as Record<string, unknown>);
      if (!(converted instanceof z.ZodObject)) {
        throw new Error(`cave_claude_tool_schema_unsupported:${item.name}`);
      }
      const execute = createHarnessToolExecutor({
        definition,
        tool: item,
        sandbox,
        ...(options.sandboxProfile === undefined ? {} : { sandboxProfile: options.sandboxProfile }),
        ...(options.engineBin === undefined ? {} : { engineBin: options.engineBin }),
      });
      const wireName = `mcp__caveman_agent__${item.name}`;
      toolNames.add(wireName);
      return claudeTool(
        item.name,
        item.description,
        converted.shape,
        async (args) => {
          const value = await execute(args, controller.signal);
          if (!isRecord(value) || !Array.isArray(value.content)) {
            throw new Error(`cave_claude_tool_result_invalid:${item.name}`);

View on GitHub (pinned to 766dce6b13)