encode_toon
Convert JSON data into compact TOON format to reduce token usage in LLM prompts.
Instructions
Convert JSON data into compact TOON format to save tokens.
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": {
"json": "<json>"
},
"name": "encode_toon"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | Yes | The JSON data (as a string) to encode into TOON format. | |
| indent | No | Number of spaces for indentation. Defaults to 2. | |
| replacer | No | Array of properties to include in the output. If not provided, all properties are included. | |
| delimiter | No | Delimiter for array values (comma, tab, or pipe). Defaults to comma. | |
| keyFolding | No | Collapse single-key wrapper chains into dotted paths. Defaults to 'off'. | |
| flattenDepth | No | Maximum depth for key folding. Defaults to Infinity. |