Skip to main content
Glama

Optimize Model

optimize_model
Destructive

Optimize an agent's model for cost or speed without losing quality. Benchmarks cheaper/faster models, picks the best one, switches to it, and triggers prompt adaptation. Returns a jobId — use get_model_optimization_status to poll.

Input Schema

NameRequiredDescriptionDefault
targetNoOptimization target: 'cost' (cheapest passing model), 'speed' (fastest), 'balanced' (best score-to-cost ratio). Default: 'cost'.
agentIdYesThe agent ID to optimize. Must be active with runs.
maxTurnsNoMax conversation turns per scenario (default: 3).
customerIdNo(Converra superadmin only) Target customer ID.
qualityThresholdNoMinimum quality as percentage of current model's score (0-100). E.g., 85 means candidates must score >= 85% of current model. Default: 85.
skipOptimizationNoIf true, switch model without triggering prompt adaptation. Default: false.
candidateModelIdsNoOptional specific model IDs to evaluate. If omitted, candidates are auto-selected based on target. Fine-tuned accounts/... ids are not accepted here; benchmark them with benchmark_models.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations flag destructiveHint=true and readOnlyHint=false, but the description adds genuinely new behavioral information: it is a multi-stage job that benchmarks, *switches the agent's live model*, and triggers prompt adaptation, returning a jobId rather than a result (async). It stops short of saying whether the switch is reversible or how long a job takes.

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 sentences, zero filler, front-loaded with the outcome ('for cost or speed without losing quality'), followed by the mechanism and the polling instruction. Every sentence earns its place.

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 no output schema, the description correctly supplies the return contract (jobId) and the polling path. The remaining gap is operational: it omits likely execution duration, whether the model switch is applied immediately to production, and the rollback/revert route despite stop_optimization and delete_optimization existing as siblings.

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 all seven parameters (including target enum semantics, qualityThreshold, skipOptimization, and the superadmin customerId) are already fully documented in the schema. The description only echoes 'cost or speed' and 'without losing quality', adding no syntax or format detail, so baseline 3 applies.

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?

States a specific verb (optimize) and resource (an agent's model) plus the multi-step scope: benchmark candidates, pick the best, switch, and trigger prompt adaptation. This distinguishes it cleanly from neighbors like benchmark_models, start_model_test, and trigger_optimization, which do only parts of that workflow.

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?

Names the follow-up sibling explicitly ('use get_model_optimization_status to poll'), which is the most important routing decision for an async job. However, it never says when to prefer this over trigger_optimization, benchmark_models, or start_model_test, nor does it state preconditions (active agent with runs) that the schema only implies.

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