Skip to main content
Glama

llmtrim_compress

Compress an LLM request body and report token savings. Pass raw request JSON; receive compressed request with token counts and breakdown.

Instructions

Compress an LLM request body and report the token savings. Pass the raw request JSON; get back the compressed request in the same shape plus before/after token counts and the per-stage breakdown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYesThe provider request body (OpenAI, Anthropic, or Google shape). Accepts either the JSON object itself or a JSON string of it; the whole body is compressed and returned in the same shape.
providerNoProvider hint: `openai`, `anthropic`, or `google`. Leave unset to detect it from the request shape.
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool accepts JSON objects or strings, returns the compressed request in the same shape, and provides before/after counts and per-stage breakdown. However, it does not detail error handling, performance characteristics, or any side effects, which would strengthen transparency.

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, front-loaded with the primary purpose. Every sentence adds value; no wasted words. The structure is efficient and clear.

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 the tool has only 2 parameters (1 required) and no output schema, the description covers the essential behavior: what it does, input format, and output structure. It could be improved by explaining the per-stage breakdown format, but overall it is fairly 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%, meaning the schema already documents both parameters. The description adds that the request body can be an object or string and that the whole body is compressed and returned, but this is largely redundant with the schema. Baseline 3 is appropriate.

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 'Compress an LLM request body and report the token savings' with specific verb and resource. It distinguishes from siblings by mentioning the request body shape, which contrasts with the likely plain-text focus of 'llmtrim_compress_text'.

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 provides clear context for when to use: when you have a provider request body to compress and get token savings. It does not explicitly state when not to use or compare with siblings like 'llmtrim_compress_text' or 'llmtrim_stats', but the context is sufficient for an agent to infer.

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/fkiene/llmtrim'

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