Skip to main content
Glama

compress

Reduce bloated tool output or long text to fit a token budget while preserving content relevant to an optional query. Returns a compact extract with a reference to retrieve the full output later.

Instructions

Compress a bloated tool output or long text so it fits a token budget while keeping what's relevant to an optional query. Returns a compact extract; the full output stays retrievable via the ref in its footer — call expand_tool_output with that ref to read it back.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesthe tool output / long text to compress
queryNooptional relevance query — keep what's on-topic for this
max_tokensNotoken budget (default 512)
Behavior4/5

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

With no annotations, the description carries the responsibility of behavioral disclosure. It explains that the result is a compact extract with a footer ref, that the full output remains retrievable via that ref, and how to use the sibling tool to retrieve it. This goes beyond a simple one-liner and gives the agent a clear mental model of the tool's side effects.

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: the first establishes purpose and the second explains the return format and retrieval path. It is front-loaded with the key action, contains no filler, and every clause earns its place. Perfectly sized for a tool of this complexity.

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 three parameters, no output schema, and one sibling tool, the description adequately explains what the tool returns ('a compact extract'), how to access the full output (via ref in footer), and how that connects to expand_tool_output. It does not mention edge cases or validation rules, but for a straightforward compression tool it is sufficiently complete.

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?

Schema description coverage is 100%, so each parameter is described in the schema. The description itself adds little new meaning: it reiterates 'optional query' and 'token budget' but does not provide additional context beyond what the schema already specifies. Baseline 3 is appropriate given the high schema coverage.

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 verb ('Compress'), the resource ('a bloated tool output or long text'), and the specific goal ('fits a token budget while keeping what's relevant'). It also distinguishes from the sibling tool by explaining the ref mechanism and pointing to expand_tool_output for retrieval.

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?

The description gives clear context for use (when output is bloated or needs to fit a token budget) and references expand_tool_output as the complementary tool for reading the full output. It lacks explicit exclusions or 'when not to use' but covers the primary usage scenario well.

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/nac7/tooltrim'

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