Skip to main content
Glama

slimtoken.prune_context

Prune conversation context to fit token budgets: retain relevant warm entries, summarize old turns, and strip low-value text for efficient prompt injection.

Instructions

RAG-style context pruning for a memory/conversation store: strip low-value text, retrieve warm entries relevant to a query, sliding-window summarize old turns, and enforce a token budget. Returns a ready-to-inject / prompt block.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNocurrent query for relevance retrieval
cold_dataNocold memory keyed by category (each value is a list of entries)
max_tokensNo
warm_entriesYeswarm/conversation entries (role+content dicts)
Behavior3/5

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

With no annotations provided, the description carries the full transparency burden. It outlines the internal algorithm (strip, retrieve, summarize, enforce) and the return type, but it does not disclose whether the operation is read-only, whether it modifies the underlying store, or any side effects such as data loss. This ambiguity prevents a higher score.

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

Conciseness5/5

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

The description is two sentences, front-loaded with the primary purpose, and includes only essential details. Every phrase contributes to understanding the tool's behavior and output, with no filler or repetition.

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?

The description explains the return value (a prompt block with cold_memory/recent_context), which is essential since there is no output schema. It also covers all key operations and the overall context of use. However, it does not specify the exact structure of cold_data beyond the schema, nor does it mention the required parameter warm_entries, though the schema handles that.

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 schema already describes 3 of 4 parameters (75% coverage), and the description adds marginal context by linking 'query' to relevance retrieval and 'warm entries' to sliding-window summarization. However, it does not add significant new meaning or format details beyond what the schema provides, especially for cold_data and max_tokens.

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 'prunes context' in a RAG-style manner, detailing specific operations: stripping low-value text, retrieving warm entries, summarizing old turns, and enforcing a token budget. This distinguishes it from sibling tools like optimize_messages or estimate_tokens, which focus on different aspects of token management.

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 description implies usage for context pruning in memory/conversation stores but does not explicitly state when to use this over alternatives. No comparisons are made to sibling tools like optimize_messages or minify_tool_result, so the guidance is implied rather than explicit.

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/greyok00/slimtoken'

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