Shrink MCP tool descriptions and JSON schemas to cut context cost — without changing how agents call them.
| Tool | Tokens before | Tokens after | Saved | Reduction | Description chars |
|---|---|---|---|---|---|
| search_customers | 186 | 66 | 120 | 64.5% | 322 → 76 |
| refund_order | 144 | 64 | 80 | 55.6% | 212 → 34 |
[
{
"name": "search_customers",
"description": "allows you to search through the customer database to find matching records.",
"inputSchema": {
"type": "object",
"required": [
"query"
],
"properties": {
"query": {
"type": "string"
},
"limit": {
"type": "number"
},
"status": {
"type": "string",
"enum": [
"active",
"churned",
"trial"
]
}
}
}
},
{
"name": "refund_order",
"description": "issues a refund for a given order.",
"inputSchema": {
"type": "object",
"required": [
"orderId"
],
"properties": {
"orderId": {
"type": "string"
},
"amount": {
"type": "number"
},
"reason": {
"type": "string",
"enum": [
"duplicate",
"fraudulent",
"requested_by_customer"
]
}
}
}
}
]Token counts are estimates from a character-based model, not measured tokenizer output. Always re-test your agent after compressing: this tool preserves enum values and required lists, but a description you trimmed to one sentence may have carried nuance your model relied on to choose correctly.
Tool descriptions are written for humans browsing a README, then loaded verbatim into every single request. The waste is remarkably consistent: hedging(“This tool allows you to…”), restatement (a sentence explaining what the function name already says), examples in prose, and schema decoration — default, examples and paragraph-long property descriptions that the model rarely needs to select a tool. None of it changes how the tool is called, and all of it is re-sent on every turn. The key safety property here: enum values and required lists are never touched. Those define the call contract, so stripping them would break invocation rather than merely shorten it. What gets cut is prose and decoration — which is why a typical safe reduction lands in the 40–70% range without a behaviour change.
Type information, enums and required lists define how the model calls your tool, so they are always preserved. Descriptions, defaults, examples and long property text only help a human reader, so they are reduced or removed.
A server exposes search_customers and refund_order. Both descriptions were written for a README: they hedge, restate the function name, and inline examples. Both schemas carry defaults and paragraph-length property text.
Why did the cow cross the road?
No signups, no data sold. The core of every tool is free forever — the optional Pro plan adds batch processing, unlimited downloads, white-label exports and an ad-free experience.
☕Support me on Ko-fi— keep tools free100% of proceeds go towards hosting & building more free tools.