Skip to main content
Glama

prune_context

Free up context by trimming old messages when usage exceeds 70%. Works live without restart.

Instructions

Free up context by trimming old messages. Works live without restart. Use when context_status shows >70% usage. Before pruning, save any important findings with save_wisdom so they survive the trim. Typical workflow: save_wisdom → prune_context(mode:"oldest_percent", percent:40) → continue working with more room.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYesPruning mode: "before_message" trims before a specific message number, "oldest_percent" trims the oldest N% of messages, "after_phrase" finds a message containing a unique phrase and makes it the new root.
phraseNoFor after_phrase mode: a unique phrase to search for in the conversation. The first message containing this phrase becomes the new root, everything before it is orphaned.
percentNoFor oldest_percent mode: trim this percentage of messages from the beginning (0-100).
message_numberNoFor before_message mode: trim everything before this message (1-indexed from chain start). The target message becomes the new root.
conversation_idNoConversation UUID. If omitted, finds the most recently modified conversation for the current project. Your conversation ID is shown in your status bar as [xxxxxxxx].

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior3/5

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

No annotations are provided, so the description carries full burden. It reveals that pruning is destructive (warnings about saving findings first), works live without restart, and explains the trim mechanics across modes. However, it doesn't disclose what happens to pruned messages (recoverability, whether they're in inspect_pruned_messages), which would be valuable given the destructive nature. The 'orphaned' and 'becomes the new root' details are helpful behavioral transparency, but recovery information is missing.

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

Conciseness4/5

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

The description is tightly written with actionable guidance in two sentences plus a workflow example. Every sentence earns its place. Minor deduction: the workflow example partially repeats what the parameter descriptions already cover, but it's compact and illustrative rather than padding.

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

Completeness4/5

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

For a destructive operation with 5 parameters and no output schema, the description does well: explains when to use, what the workflow should be, how each mode works. However, it doesn't mention whether pruned messages can be recovered or inspected afterward (sibling inspect_pruned_messages suggests they might be), and there's no mention of output/return behavior. Given the destructive nature and no output schema, slightly more behavioral detail would push this to 5.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by explaining the mode mechanics ('trims before a specific message number', 'everything before it is orphaned') and by clarifying the workflow ordering. It also adds practical context to conversation_id (how to find it in the status bar). The description does repeat some schema content, but the additional usage context (1-indexed, new root behavior, status bar hint) elevates it above baseline.

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?

The description uses a specific verb+resource: 'Free up context by trimming old messages.' It clearly states the purpose and differentiates from siblings like compact_context by describing the live-no-restart behavior and the explicit workflow with save_wisdom. The sibling tools (compact_context, inject_context) are distinct in purpose.

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

Usage Guidelines5/5

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

Provides explicit when-to-use guidance ('when context_status shows >70% usage'), names the prerequisite save_wisdom step, and gives a typical workflow sequence. This is exceptionally actionable guidance that tells the agent exactly when and how to invoke the tool.

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