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].
Behavior4/5

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

With no annotations, the description must fully disclose behavior. It states 'works live without restart' and warns to save important findings with save_wisdom to survive the trim. However, it does not mention whether pruning is reversible or how the response indicates success.

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?

Three sentences and a workflow example efficiently convey purpose, usage, and mode options. No redundant information; every sentence serves a purpose. Could be slightly improved by listing modes more compactly, but it's well-structured.

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?

Given 5 parameters and no output schema, the description explains the three pruning modes but omits what the tool returns (e.g., success confirmation, new context size). The workflow example is helpful, but the lack of return value information is a gap.

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

Parameters3/5

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

The input schema covers 100% of parameters with descriptions, so the baseline is 3. The description adds a concrete example (percent:40) but does not enrich understanding beyond what the schema already provides for each parameter.

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 clearly states the tool's purpose: freeing context by trimming old messages. It distinguishes itself from sibling tools like 'context_status' (which only shows usage) and 'save_wisdom' (which preserves info), making its unique role evident.

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

Usage Guidelines4/5

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

Explicitly advises using when 'context_status shows >70% usage' and provides a typical workflow: save_wisdom → prune_context → continue working. It does not explicitly exclude scenarios (e.g., before critical operations), but the guidance is clear and actionable.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/InfiniQuest-App/wisdom-store'

If you have feedback or need assistance with the MCP directory API, please join our Discord server