agent_tooltrim
Which MCP tools to DISCONNECT to fit a token budget, and the exact re-count after: paste one tools/list, optionally the calls_30d your logs measured, and the budget (tokens, or a percent of the window — the published 10% auto-load rule). Drops fall in CLOSED classes in exact fractions, never floats: IDLE_30J first (paying every turn, never used — the rule practitioners publish from their own session logs), then worst cost-per-call, then NEVER what was not measured: UNKNOWN tools are cut last and flagged UNKNOWN_CUTS. keep protects names; a keep floor that misses the budget alone returns STILL_OVER with the overage chiffré, not advice. The re-count is the sister's own arithmetic — ceil of the survivor chars /4, the published floor estimator quoted — so pasting the survivors into /agent/context-tax MUST return the identical number; global vs sum-of-ceilings travel together and the divergence is stated (b101/b104 law). Ties: chars desc, then name ascending (declared). Verdicts CLOSE: FITS_AS_IS (nothing to cut — savings are zero, and the tool says so), TRIMMED_FITS, STILL_OVER. Saving repeats EVERY turn (the list is not paid once); dollars only if you pass your own decimal price — no stored price table. Ceiling 5000 tools, duplicate/empty names refused (shadowing, family); top 100 plan rows, the rest folded. Never fetches, never reads your logs: pasted listing only. Sisters: context-tax says HOW MUCH, cost-diff says the price in between — this one says WHAT TO CUT. Free under 32 KB, x402 above.
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": {
"tools": "<tools>"
},
"name": "agent_tooltrim"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keep | No | tool names you refuse to disconnect; each must appear in tools | |
| tools | Yes | the pasted tools/list array (same shape /agent/context-tax measures) | |
| turns | No | turns the saved listing would have ridden (default 1) | |
| usage | No | tool name -> calls over the last 30 days, from YOUR logs; absent name = UNKNOWN class, never ranked ahead of measured idle | |
| budget | No | tokens the definitions may occupy — exclusive with budget_pct | |
| window | No | your context window in tokens, default 200000 | |
| budget_pct | No | budget as a percent of the window, 1..100 (e.g. 10 — the published auto-load rule); floored, exclusive with budget | |
| input_per_mtok | No | YOUR price per million input tokens, decimal string (e.g. "2") — an argument, never a stored table |