Skip to main content
Glama

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

NameRequiredDescriptionDefault
messagesYesUp to 500; 400000 characters of content in total.
strategyNoOrder in which droppable units are removed. Default oldest-first.
tokenizerNoo200k_base or cl100k_base. Any other name (including Claude models) returns status unsupported for items that need counting; caller token counts are always accepted.
keepRecentNoMost recent messages that are never dropped. Default 4.
targetTokensYesTotal tokens to get at or under.
cacheBreakpointYesIndex of the last message inside the cached prefix; -1 when nothing is cached.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and mostly succeeds: it makes clear this is a planner that returns which messages to drop rather than mutating anything, explains the pairing invariant (no tool_result left without its call), and names failure behavior (unsupported tokenizer names return status unsupported for items needing counting, caller token counts always accepted). The dangling final fragment leaves the behavior description incomplete at the tail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The lead clause is well front-loaded and information-dense, but the body is one long run-on colon-list that is hard to parse. More importantly, the description is visibly truncated mid-sentence ("Everything up"), leaving a dangling fragment that wastes space and signals missing content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description is responsible for return semantics. It says it returns which messages to drop and mentions a per-item 'status unsupported', but never specifies the return shape (indices vs ids, ordering of the returned set, whether a token total is included). Combined with the truncated ending, an agent knows the contract's intent but not its exact output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so this is value added on top: it ties cacheBreakpoint to the provider's cached prefix, explains that strategy controls oldest-first vs largest-first removal ordering, states the keepRecent protection rule, and justifies pair-dropping semantics tied to toolCallId — meanings the schema does not convey on its own.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — choose which old messages to drop to hit a token target — and immediately names the hard constraint (never touch the cached prompt prefix). It then enumerates exactly what is eligible (whole tool_call/tool_result pairs, caller-marked droppable messages) and what is protected, which is far more than a restatement of the name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The opening clause implies the situation (you have a token target and a cached prefix), and the constraint list sketches the boundaries of legitimate use. But there is no explicit when-to-use/when-not-to-use statement, no mention of a prerequisite or follow-up step (e.g. that the caller must apply the returned drops itself), and no named alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources