conversation-prune
Choose which old messages to drop to hit a token target without touching the cached prompt prefix — Given a conversation, the index of the last message inside the provider's cached prefix, and a token target, returns which messages to drop: whole tool call plus tool result pairs (so no result is left without its call) and messages the caller marked droppable, oldest first or largest first, never inside the cached prefix, never the most recent keepRecent messages, never pinned ones. Everything up
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": {
"messages": "<messages>",
"cacheBreakpoint": "<cacheBreakpoint>",
"targetTokens": "<targetTokens>"
},
"name": "conversation-prune"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | Up to 500; 400000 characters of content in total. | |
| strategy | No | Order in which droppable units are removed. Default oldest-first. | |
| tokenizer | No | o200k_base or cl100k_base. Any other name (including Claude models) returns status unsupported for items that need counting; caller token counts are always accepted. | |
| keepRecent | No | Most recent messages that are never dropped. Default 4. | |
| targetTokens | Yes | Total tokens to get at or under. | |
| cacheBreakpoint | Yes | Index of the last message inside the cached prefix; -1 when nothing is cached. |