Skip to main content
Glama

Last Price

create_routing_policy

Add a routing policy: how a price request picks a pricing function. The strategy is cheapest, fastest, explicit, round robin, weighted (needs weights with at least one above zero), policy (rules that send matching requests to a function) or default. Set is_default to make it the policy used when no function is named; that replaces the current default. Needs a Last Price credential with routing write scope. Needs a claimed workspace: a sandbox key from self-registration is refused (403) until a person claims the workspace.

Input Schema

NameRequiredDescriptionDefault
nameYesA name for the policy.
configNoWhat the strategy needs. weights gives each function id a share (weighted). rules each send requests whose field matches to a function (policy). fallback_chain lists function ids to try in order when the strategy picks none.
strategyYesHow a function is picked.
is_defaultNoMake this the workspace default. Defaults to false.
fallback_function_idNoA function to use when the strategy picks none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover the safety profile (non-readOnly, non-destructive, non-idempotent), and the description adds genuinely beyond-schema context: setting is_default replaces the current default, a routing-write-scoped Last Price credential is required, and unclaimed sandbox workspaces get a 403. It stops short of saying whether the policy is active immediately or what a duplicate-name collision does.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core definition and strategy list before prerequisites; every sentence carries information. It is dense as a single block, and the auth/workspace sentences could be separated for scannability, but there is no filler.

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 5-parameter tool with nested config objects and no output schema, the description covers purpose, strategy semantics, default-replacement side effect, and auth gating well. It leaves out what the created policy returns (no output schema to compensate) and per-strategy config requirements beyond weighted.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real semantic value by defining what each strategy enum value means and the constraint that weighted requires at least one weight above zero. The nested rules/weights config semantics are largely left to the schema's own descriptions.

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 ('Add a routing policy') and immediately defines the resource in functional terms: 'how a price request picks a pricing function.' The enumeration of strategies and their meanings makes the tool's scope unmistakable versus siblings like delete_routing_policy or update_routing_policy.

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?

Explains when each strategy applies (weighted needs weights with one above zero; policy uses rules; default as fallback) and when to set is_default. However, it never explicitly distinguishes this from update_routing_policy or says when to create a new policy versus modify an existing one.

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