Skip to main content
Glama

context_compress

Compress a prompt payload before it reaches an LLM.

Shrinks JSON tool outputs, logs, and long text using SmartCrusher-lite sampling. Originals are stored in CCR (Redis) with ref= markers for context_retrieve. Always runs; tune thresholds via TEAMSHARED_COMPRESS_*.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messagesYesOpenAI-style chat messages to compress before sending to an LLM. User messages are preserved; long tool/assistant/system blocks shrink.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description must disclose side effects and behavior. It does mention that originals are stored in CCR (Redis) with ref= markers for retrieval, and that it 'Always runs' and thresholds are tunable. However, it doesn't describe the return value, potential data loss, or any permissions needed. It gives some behavioral transparency but leaves gaps.

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 concise, with the key purpose in the first sentence. It provides necessary details in two more sentences without excess. The structure front-loads the purpose and then elaborates on behavior and configuration. No fluff.

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?

The tool has a single parameter with good schema coverage and an output schema (not shown). The description explains the purpose and storage side effect but doesn't detail the return format (presumably in output schema), nor does it mention any prerequisites like Redis availability or error conditions. Given it's a straightforward compression tool with one input, it's fairly complete but could state expected output behavior more explicitly.

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 description already covers the 'messages' parameter well, stating it's OpenAI-style chat messages and that user messages are preserved while long tool/assistant/system blocks shrink. Since schema coverage is 100%, the description adds only minor reinforcement (mentions JSON tool outputs and logs) but doesn't significantly extend meaning beyond the schema.

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 a prompt payload before sending to an LLM, and specifies what it shrinks (JSON tool outputs, logs, long text). It distinguishes itself from other context tools by focusing on compression and storage of originals. It's not a tautology and gives a specific verb-resource pairing.

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 says 'Always runs' but does not provide explicit when-to-use or when-not-to-use guidance, nor does it name alternatives. It hints at a companion tool (context_retrieve) but doesn't tell the agent when to choose this over other context tools like context_normalize or context_prepare. The 'always runs' suggests it might be automatic, which is a usage signal but not a clear directive.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.