Skip to main content
Glama

Agentic Endpoints

Compress text to a token budget

compress
Read-onlyIdempotent

Reduce text to fit a token budget, preserving whole sentences and reporting before/after token estimates. Costs $0.010 in USDC on Base, paid via the x402 protocol, or from a credit token — call credits_trial for free credit if you have neither.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to compress
strategyNoCompression strategy (default extractive)
credit_tokenNoOptional. A credit token from credits_trial or /credits/buy. Supplying it pays for this call from that balance, so no x402 payment or wallet is needed.
target_tokensNoApproximate token budget

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe compressed text
ratioYescompressed_length / original_length. Lower is more aggressive.
strategyNoStrategy applied, echoing your request
original_lengthYesInput length in characters
compressed_lengthYesOutput length in characters

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

The description discloses a behavior not present in annotations: the call costs $0.010 paid via x402 or a credit token, plus it promises whole-sentence preservation and before/after token estimates. These are meaningful runtime traits beyond the readOnly/idempotent hints, and there is no contradiction with the annotations.

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 sentences with no filler: the first states the operation and its guarantee, the second states cost and payment alternatives. The most important information is front-loaded and every clause supports an invocation decision.

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 an output schema present and full parameter documentation in the schema, the description needs only to add what schemas don't show: cost, payment route, and the credits_trial fallback. It covers those; a small gap is that it doesn't mention the strategy default, but that is already in the input schema.

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 the schema already documents text, strategy, credit_token, and target_tokens. The description adds only high-level context (whole-sentence preservation, cost) rather than new parameter-level detail, matching the baseline for full 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?

Description opens with a specific verb and object ('Reduce text') and defines a precise goal: fit a token budget while preserving whole sentences and reporting before/after estimates. This clearly separates it from siblings like meetings_summarize and names the resource it acts on.

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 important context for when to use the tool (when text must fit a token budget) and directly handles the payment prerequisite by pointing to credits_trial. It does not explicitly exclude alternatives or tell an agent when not to use compress, so the guidance remains 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources