json_coerce
Repair tool-call ARGUMENTS a strict reader rejects, per a declared flat schema, WITHOUT guessing: 8.0 -> 8 in an integer slot (the published magpie #3152 serde class: 'invalid type: floating point 2500.0, expected u64' — measured 11/11 turns), exponents and real fractions LEFT AS WRITTEN (the fix's own scope), quoted 'false' refused BY NAME (the PraisonAI #6369 truthy trap), string->number only with cast_strings='on', '007' NEVER cast (leading zeros are payload: phone, CNPJ, SIREN), duplicate keys refused, bounds named (u64|i64|u32|i32). Output preserves the literal notation: coerced_text re-emits 1.0e3 as 1.0e3. strict='true' turns refusals into the 400 repair prompt. Free.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"raw": "<raw>",
"schema": "<schema>"
},
"name": "json_coerce"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | Yes | the exact JSON text of the tool-call arguments, e.g. '{"limit": 8.0}' | |
| schema | Yes | {key: type} over integer|u64|i64|u32|i32|number|string|boolean|array<those} | |
| strict | No | off | |
| cast_strings | No | off |