Skip to main content
Glama

TokenZero

optimize_prompt_payload

Rewrite an OpenAI Chat/Responses or Anthropic Messages request body so its static prefix is provider-cacheable (Anthropic cache_control breakpoints, OpenAI prompt_cache_key). Returns the optimized body, what changed, the token profile and the projected per-request saving. Never changes the tokens the model sees.

Input Schema

NameRequiredDescriptionDefault
bodyYesThe request body
endpointNo
strategyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does reasonably well: it discloses the returned artifacts (optimized body, diff of changes, token profile, projected per-request saving) and gives a strong behavioral guarantee that the tokens the model sees are never changed, which tells the agent this is a safe, semantics-preserving transformation. It stops short of saying whether the provider is contacted, whether credentials are required, or whether the input body is mutated in place.

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 tight sentences, zero filler, with the transformation and its target front-loaded before the return contract and the safety guarantee. Every clause earns its place.

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 return values are well covered, which is good given there is no output schema, and the core behavior is clear. But for a tool with two unexplained enum parameters and an opaque nested object body, the description leaves out the information an agent needs to actually construct a correct call.

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?

Schema coverage is only 33% — 'body' is documented merely as 'The request body' and both 'endpoint' and 'strategy' are bare enums with no meaning attached. The description adds nothing about them: it never explains that 'endpoint' selects the provider dialect or what 'static' versus 'conversation' strategy implies, and the nested body shape is left entirely undocumented.

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?

Specific verb (rewrite) plus a precisely scoped resource (an OpenAI Chat/Responses or Anthropic Messages request body) and the intended effect (making the static prefix provider-cacheable). It also names the concrete mechanisms (cache_control breakpoints, prompt_cache_key), which no sibling tool does, so an agent can distinguish it immediately from the token-accounting siblings.

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 implies the situation (you have a request body with an uncached static prefix) but never states when to call this versus audit_repo_token_waste or calculate_model_arbitrage, nor any preconditions such as needing a valid, complete body. Usage is inferable 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.