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 arequiredarray listing all property keys. - Missing
additionalProperties: injectsadditionalProperties: falseon every object level. - Nested object repair: repairs apply recursively to nested objects, array items, and
oneOf/anyOfbranches.
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: falseand completerequiredarrays. - Anthropic — unsupported keywords like
$schemaandexamplesare 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.