Compress prompt
compress_promptCompress prompts, system prompts, or context blocks to reduce token usage with deterministic rule-based processing that preserves template variables and returns token stats.
Instructions
Compress a prompt, system prompt, or context block to use fewer tokens, using deterministic rule-based algorithms (no LLM call). Template variables like {{name}} and {var} are preserved. Returns the compressed text and token stats.
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": {
"text": "<text>"
},
"name": "compress_prompt"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to compress. | |
| level | No | Risk level. 'none' = whitespace/unicode only; 'very-low' = + filler, phrases, JSON/SQL minify; 'low' = + hedging, comments, dedup (recommended); 'medium' = + extractive summarization (may drop sentences). | low |