Independent API referenceField notes updated 29 Aug 2026

Anthropic schema error

Reduce Anthropic’s “Schema is too complex for compilation” error

Measure optional fields and unions, then simplify a Claude strict tool schema without flattening it blindly.

Schema is too complex for compilationMany optional fieldsMany anyOf branchesStrict tool use fails

Reviewed Source: Anthropic strict tool use

Anthropic strict tools compile schemas into constrained grammars. Large numbers of optional parameters, unions, or deeply composed branches can exceed documented compilation limits.

Read the schema and its provider wrapper as one contract. APITC distinguishes target requirements from portable JSON Schema, applies mechanical repairs only when intent is recoverable, and identifies transformations that can change meaning.

Diagnostic procedure

Repair the schema, then recompile.

  1. 01

    Count structural cost

    Measure optional parameters, union-bearing fields, total properties, and nesting depth separately.

  2. 02

    Split by intent

    Separate unrelated operations into focused tools instead of one mode-heavy mega-tool.

  3. 03

    Replace unions carefully

    Use enums plus purpose-built properties when that preserves the same choice semantics.

Before
{"name":"do_everything","strict":true,"input_schema":{"type":"object","properties":{"mode":{"anyOf":[{"type":"string"},{"type":"integer"}]},"a":{"type":"string"},"b":{"type":"string"}}}}
Target-safe shape
{"name":"find_customer","strict":true,"input_schema":{"type":"object","properties":{"query":{"type":"string"},"query_type":{"type":"string","enum":["email","id"]}},"required":["query","query_type"],"additionalProperties":false}}

Interactive check

Run the schema against a real target.

Paste JSON, choose a target, and inspect the compiled shape and every portability warning before copying the result.

Contract compilerlocal browser runtime
01 Source contract APITC canonical
02OpenAI strict
80compatibility
0 errors · 2 fixes · 0 warnings
fix$.inputSchemaClose this object

OpenAI strict requires additionalProperties: false on every object.

fix$.inputSchemaRequired array is incomplete

Strict mode requires every property in required. APITC will make limit nullable.

97 tokens compiled · input never leaves this tab

No account · no upload · no endpoint calledOpen the full tool schema compiler and operating notes →

FAQ

Before you ship

Does APITC upload my schema?

No. Parsing, diagnostics, and compilation run in your browser tab.

Is the compiled result guaranteed to preserve meaning?

Safe repairs are deterministic. When Anthropic cannot express a source constraint, APITC labels the transform as lossy instead of hiding it.

Protocol behavior checked against the Anthropic strict tool use. Recheck your pinned provider/API version before production deployment.