Skip to main content
Glama

ai_context_compress

Read-only

Context compressor — Shrink long text to a token budget for an LLM context window while keeping numbers, dates, names, decisions and deadlines. tokens= sets the target (default 30% of the input), keep= lists terms that must survive. Offline checks report missing numbers, missing keep-terms, names kept and tokens saved; text already within budget is returned unchanged without a model call. Price: $0.008 USDC (Base, via x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "ai_context_compress"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYese.g. Hi team, following up on Tuesday's call with Acme Corp. They agreed to a 12-month contract at $48,000, starting January 15, 2027, with net 30 payment terms. Legal still needs to review the data processing addendum by December 10. Thanks, everyone, for all the hard work on this one!

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered; the description adds real value beyond that by disclosing the no-model-call short-circuit, the offline verification checks performed, and a per-call price ($0.008 USDC via x402). It stops short of describing failure modes or how truncation quality degrades when the budget is very small.

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?

Front-loaded with the core verb and resource, then layered detail on budget, retention, checks, and price. Dense but each sentence carries operational information; the stray parameter notation (`keep=`) is terse enough to be ambiguous rather than clarifying.

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?

With no output schema, the description correctly takes on the burden of explaining results — missing numbers, missing keep-terms, names kept, tokens saved — which is exactly what an agent needs to interpret the return. The remaining gap is the inconsistency between the documented `tokens`/`keep` controls and the single-parameter schema.

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

Parameters2/5

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

The description documents `tokens=` (default 30% of input) and `keep=`, but the input schema exposes only a single `text` property at 100% coverage. This is a direct mismatch: an agent following the description will attempt to pass parameters that do not exist, and the schema's own example is the only guidance for the one real parameter. The added text is therefore partly misleading rather than additive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Shrink long text to a token budget for an LLM context window while keeping numbers, dates, names, decisions and deadlines" gives a specific verb, a specific target resource, and preserves-list scope. It is clearly a compression-for-context tool, though it never distinguishes itself from near neighbors like ai_prompt_compress or ai_abstract, leaving the agent to infer which compressor is appropriate.

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?

It supplies useful operating context: text already within budget is returned unchanged without a model call, implying a pre-check before spending. But there is no explicit when-to-use/when-not-to-use guidance and no named alternative for cases like summarizing rather than budget-constrained compression, so selection between siblings remains inferred.

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.

Resources