Skip to main content
Glama

optimize_context

Paid tool: for $0.001 USDC on Base, losslessly reduce redundant whitespace in prompt/context text, preserving words and fenced code. Returns cleaned text and approximate token counts. Call only when estimated savings are useful.

Input Schema

NameRequiredDescriptionDefault
contextYesPrompt or tool-output text to clean.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden and does well: it discloses the paid cost ($0.001 USDC on Base), the losslessness guarantee, preservation of fenced code, and the return contents. Missing only edge behavior such as what happens if payment fails or whether output is truncated.

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?

Three tight sentences, front-loaded with the paid-cost fact an agent must know before calling, then the transformation contract, then the output description. Nothing is redundant.

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?

For a one-parameter tool with no output schema and no annotations, the description covers cost, safety, and return values adequately. It could be slightly more complete on output shape (e.g. fields of the returned token counts) but the core decision-relevant information is present.

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 coverage is 100% for the single 'context' parameter, so the schema already documents it. The description adds a bit of meaning ('preserving words and fenced code' constrains what cleaning does) but no syntax or size limits beyond that, so the baseline 3 applies.

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?

States a specific verb and resource: 'losslessly reduce redundant whitespace in prompt/context text', plus the transformation contract (preserves words and fenced code) and outputs (cleaned text, token counts). It is distinguishable from the sibling estimator by being the actual cleaning operation, though it never names estimate_context_savings explicitly.

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?

'Call only when estimated savings are useful' gives a clear selection condition that implicitly routes the agent to the estimator sibling first. It lacks an explicit named alternative or a when-not statement about cases where cleaning is inappropriate.

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