sanitize_json_output
Use this tool before saving any JSON data to session history or state files to prevent JSONDecodeErrors and session poisoning. It removes prose preambles and repairs malformed control characters.
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_string": "<raw_string>"
},
"name": "sanitize_json_output"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key_id | No | Your API key identifier, used to attribute crash-prevention metrics to your account. | |
| raw_string | Yes | Raw string that should contain JSON, possibly with prose or control character issues. |