Skip to main content
Glama

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

TableJSON 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 declare readOnlyHint=false and destructiveHint=true, and the description adds meaningful context beyond them: the multi-step benchmark→pick→switch→adapt process and the fact that prompt adaptation is triggered (mutation of prompts, not just model). It stops short of noting reversibility or rollback, which the destructiveHint would warrant.

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 with the capability front-loaded and the async follow-up clearly appended. Zero wasted words.

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 complex 7-parameter mutation tool with no output schema, the description covers the workflow and the return handle (jobId) plus the polling pattern. The only gap is lack of guidance on reversibility/rollback given destructiveHint=true.

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 7 parameters (including the target enum and candidateModelIds constraints) are fully documented in the schema. The description adds no parameter-level detail beyond the schema, so the 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?

States a specific verb and resource ('Optimize an agent's model') plus the dimensions of optimization (cost or speed without losing quality). It also enumerates the concrete steps (benchmarks, picks, switches, triggers prompt adaptation), so an agent knows exactly what this does versus read-only siblings like get_model_optimization_status.

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?

Gives clear context ('for cost or speed without losing quality') and names the exact follow-up tool for polling the async job. It does not explicitly state when NOT to use it versus siblings like benchmark_models or trigger_optimization, though the distinction by workflow stage is implied.

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