Schema Normalization

Automatic tool schema repair for cross-provider compatibility

Different providers enforce different JSON Schema constraints. TheRouter normalizes tool schemas at request time so the same definitions work everywhere.

Repairs applied

  • Missing required: adds a required array listing all property keys.
  • Missing additionalProperties: injects additionalProperties: false on every object level.
  • Nested object repair: repairs apply recursively to nested objects, array items, and oneOf/anyOf branches.

Before and after

Your input
{
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "address": {
      "type": "object",
      "properties": {
        "city": { "type": "string" },
        "zip": { "type": "string" }
      }
    }
  }
}

Provider compatibility

  • OpenAI strict mode — requires additionalProperties: false and complete required arrays.
  • Anthropic — unsupported keywords like $schema and examples are stripped.
  • Google — schema converted to Vertex AI function-declaration subset.
Zero configuration
Schema normalization runs automatically on every request with tools. No flags or configuration needed.