Skip to main content
Glama

Last Price

run_pricing_chain

Run a pricing chain: stages one after another, each stage's price feeding the next as current_price and its metadata carrying forward, your price guardrails applied once at the end from your own current_price. Stage kinds: function (a pricing function, with an optional fallback), clamp (holds the running price inside limits) and, where model stages are switched on for your workspace, llm (a prompt that lets a model adjust the price within max_change_pct, or only annotate it) and vision (the same, looking at a public https image_url, with image_consent true; it never analyses faces or emotions). Each stage reports its price in and out; a model stage also returns its annotation. Each function stage that prices is one metered call, each model stage that answers is one metered model call. Needs a Last Price credential with price compute scope. Needs a claimed workspace: a sandbox key from self-registration is refused (403) until a person claims the workspace.

Input Schema

NameRequiredDescriptionDefault
stagesYesThe stages, in order, at most 10. The fields that apply depend on kind.
contextYesThe pricing context. currency is required.
constraintsNoOptional limits applied at the end, with your guardrails.
include_explanationNoIf true, each stage and the chain explain their price.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond annotations (readOnly=false, destructive=false, idempotent=false): it discloses billing (one metered call per pricing function stage, one metered model call per answering model stage), a 403 failure mode for unclaimed workspaces, workspace feature gating for model stages, and a privacy commitment that vision never analyses faces or emotions. These are exactly the traits an agent needs and cannot read from structured fields.

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-loaded with the chain mechanic, then stage kinds, then outputs, then prerequisites — a logical progression where every sentence carries weight. It is a dense single block, however, and the metering and credential sentences could be split into a short prerequisites list for faster scanning.

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?

With no output schema, the description carries the return shape itself ('each stage reports its price in and out; a model stage also returns its annotation'), which is precisely what the agent needs. Combined with auth scope, billing, workspace gating and stage limits, nothing material for correct invocation is missing.

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 baseline is 3, but the description adds cross-field semantics the schema cannot express: each stage's output becomes the next stage's current_price, metadata propagates forward, guardrails are measured from context.current_price, and a clamp/llm/vision first stage requires current_price to be supplied. It also explains each stage kind's role, tying the kind enum to behavior.

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 ('Run a pricing chain') and immediately defines the mechanism — sequential stages where each price feeds the next and metadata carries forward, with guardrails applied once at the end. That chaining semantic is what separates it from single-price siblings like compute_price or compute_prices_batch, so an agent can tell what it does without opening the 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?

Gives real preconditions: a Last Price credential with price compute scope, a claimed workspace (sandbox keys get 403), and the fact that llm/vision stages only work when model stages are switched on for the workspace. It does not explicitly compare against compute_price or list_pricing_pipelines as alternatives, so the when-to-prefer-this decision is left partly to inference.

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