Skip to main content
Glama
pozii
by pozii

compress_context

Compress lengthy text or chat history into a concise summary for re-injection into context. Supports offline extractive and API-backed abstractive modes.

Instructions

Compress long text or conversation history into a dense summary. Use before re-injecting large context on repeated turns.

Extractive mode (default): offline, free, uses LSA sentence ranking. Abstractive mode: higher quality but requires ANTHROPIC_API_KEY env var.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe content to compress.
target_tokensNoApproximate desired output size in tokens.
modeNo"extractive" (free/offline) or "abstractive" (LLM-backed).extractive
preserve_formatNoIf True, output as bullet points; else dense prose.
modelNoUsed for token counting (does not affect which API is called).gpt-4o

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description discloses key behaviors: extractive is offline/free using LSA, abstractive requires ANTHROPIC_API_KEY, and model param only for token counting. Could mention limits or errors but sufficient.

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?

Two clear paragraphs, no wasted words. First sentence states purpose, then usage, then mode details. Well structured and efficient.

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?

Given 5 parameters, 1 required, and output schema exists, the description covers core behavior, usage, modes, and clarifies the model parameter's role. Missing potential error handling but overall complete for the task.

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%, baseline 3. Description adds meaning beyond schema: explains 'extractive' uses LSA, 'abstractive' needs API key, and preserve_format affects output style. Adds value.

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 it compresses long text or conversation history into a dense summary. It distinguishes from siblings by specifying two modes (extractive vs abstractive) and their characteristics.

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 recommends usage 'before re-injecting large context on repeated turns' and distinguishes between modes. However, it does not directly compare with sibling tools like prune_conversation or summarize_file.

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/pozii/tokensaver'

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