Skip to main content
Glama

Generate cheapest-first routing

modelfinder_generate_routing
Read-onlyIdempotent

Generate a cheapest-first routing.json and LiteLLM proxy config from eval results, with quality guards and a personal-data policy to create fallback chains for API errors.

Instructions

Turn a finished eval run (results.json object) into a cheapest-first routing.json, with quality guards and a personal-data policy, plus a LiteLLM proxy config whose fallbacks fire on API errors only (it does not enforce the quality guards or personal-data policy). Use after modelfinder_rank_eval_results when the user wants a fallback chain. Read-only and local: no network calls, no files written. Nothing is deployed and the user's active model is not changed; returns both files as text, the model chain and notes.

Input Schema

NameRequiredDescriptionDefault
chainNoExplicit model order (candidate ids), overriding cost order.
guardsNoChecks applied to every production reply; a failure escalates to the next model.
resultsYesThe full results.json object written by eval_models.py.
pii_policyNoblock: never send prompts with personal data or secrets; warn: send and report; off: no check.warn
response_formatNomarkdown (default) for a readable summary, json for the full machine-readable result.markdown
include_unknown_costNoAppend passing models whose price is unknown.

Output Schema

NameRequiredDescriptionDefault
chainYes
notesYes
routing_jsonYes
litellm_config_yamlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.5

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, and the description adds real context on top: no network calls, no files written, nothing deployed, and the user's active model is left untouched. It also discloses a genuine limitation of the generated artifact — the LiteLLM fallbacks fire on API errors only and do not enforce the quality guards or personal-data policy — which is the kind of caveat no annotation field could convey.

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?

Four sentences, each carrying distinct load: the transformation, the prerequisite and trigger, the side-effect profile, and the return shape. The primary output is front-loaded and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter tool with nested guard objects and an output schema, the description covers what is produced, what is not touched, and the key semantic gap between the routing file and the proxy config. Return values are summarized rather than duplicated from the output schema, which is the right division of labor.

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 every parameter (guards, pii_policy, response_format, include_unknown_cost, chain) is already documented in the schema. The description adds only conceptual framing — that ordering is cheapest-first and that guards/policy exist — without per-parameter syntax or interaction detail. Baseline 3 is appropriate when the schema does the heavy lifting.

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 states a specific transformation with named artifacts: a finished eval run (results.json) becomes a cheapest-first routing.json plus a LiteLLM proxy config. It also positions itself against the sibling modelfinder_rank_eval_results, so an agent can distinguish it without opening a schema.

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?

It gives an explicit trigger: 'Use after modelfinder_rank_eval_results when the user wants a fallback chain.' That is clear sequencing plus a selection condition. It does not name what to do instead when the user wants something other than a fallback chain, so no explicit exclusion is present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.