Format JSON payload
format_json_payloadClean up and pretty-print JSON from Markdown code fences or surrounding prose, remove trailing commas, and report cleanup details while preserving values.
Instructions
Clean up and pretty-print a JSON object or array. Accepts a JSON code fence or surrounding prose and removes trailing commas, while preserving JSON values and reporting cleanup details.
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": {
"payload": "<payload>"
},
"name": "format_json_payload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indent | No | Number of spaces for indentation; use 0 for compact JSON. | |
| payload | Yes | JSON text, optionally inside a Markdown code fence or surrounded by prose. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| formattedJson | Yes | ||
| removedTrailingCommas | Yes | ||
| extractedFromSurroundingText | Yes |