Skip to main content
Glama

Optimize request

optimize_request

Analyze your planned LLM call to find a cheaper capable model and estimate savings, all performed offline.

Instructions

Check whether a cheaper capable model exists for a call you plan to make, and report the savings. Offline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
currentModelYesThe model you plan to call (alias or id).
inputTokensYesInput tokens for the call.
outputTokensYesOutput tokens for the call.
taskClassNoTask class; sets the tier the recommendation must still meet.
crossProviderNoConsider other providers too (may need a different API key). Default false.
providersNoAxis 1: provider availability allowlist (spec 5.4).
targetNoAxis 2: "self" (default) applies the client scope; "code" considers all providers.
includeLocalNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
currentYes
recommendedYes
savingsUsdYes
savingsPctYes
alreadyOptimalYes
reasoningYes
providerScopeYes
scopeSourceYes
catalogVersionYes
asOfYes
Behavior3/5

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

No annotations are provided, so the description carries full burden. It states 'Offline' (no actual call) and reports savings, but does not disclose read-only nature, permissions, rate limits, or other side effects. More detail would be helpful.

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?

The description is a single sentence, highly concise, and front-loads the purpose. Every word earns its place with no waste.

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 8 parameters and an output schema, the description provides the essential purpose and offline nature. With output schema, return details are not needed. A bit more context on parameter roles (e.g., taskClass) would improve completeness, but it is mostly adequate.

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 88% (high), so baseline is 3. The description does not add meaning beyond the schema for parameters. It sets context but does not elaborate on how parameters like taskClass or crossProvider affect the recommendation.

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 the verb 'Check' and resource 'cheaper capable model for a call you plan to make,' and reports savings. It is specific and distinguishes from sibling tools like compare_models or select_optimal_model by focusing on a planned call and being offline.

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 mentions 'Offline' implying use before making a call, but it does not explicitly state when to use vs. alternatives like compare_models or select_optimal_model. No when-not or alternative guidance is provided.

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/sachinuppal/modelcostsaver'

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