Skip to main content
Glama

Estimate the cost of a chain

estimate
Read-onlyIdempotent

Pre-price an invocation chain BEFORE spending money. Each step is either a concrete offering ("node_id/offering_id") or a select query that picks the best match, plus expected input and output tokens. Returns per-step cost bounds in USD, the pinned card_revision that makes each estimate enforceable at invocation, and chain totals. Use it to compare routes or budget a multi-model pipeline; nothing is invoked or charged.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "steps": "<steps>"
    },
    "name": "estimate"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepsYesSteps in execution order.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / steps / items / properties / select / properties / jurisdiction / description
      Previous value: -"Only operators that declare a country inside it: \"eea\" (EU + Iceland, Liechtenstein, Norway) or comma-separated ISO country codes, e.g. \"DE,FI\". Registered nodes declare their country; imported listings of known providers carry an inferred one (jurisdiction.basis = \"inferred\"); listings without a country are excluded."New value: +"Only operators that DECLARE a country inside it: \"eea\" (EU + Iceland, Liechtenstein, Norway) or comma-separated ISO country codes, e.g. \"DE,FI\". Registered nodes declare their country in their signed card; imported listings of known providers carry one the registry inferred (jurisdiction.basis = \"inferred\"); listings without a country are excluded. A declaration, not proof of where requests are processed: the registry drops only a server it located outside. jurisdiction.evidence says what was checked, e.g. \"FR operator (EEA, declared), server front checked (FR)\"; add server_check \"passed\" to keep only offerings whose check passed."
    • changedInput schema / properties / steps / items / properties / select / properties / no_training / description
      Previous value: -"true: only offerings whose data_policy says training_on_inputs is false. Offerings without a data_policy are excluded."New value: +"true: only offerings whose declared data_policy says training_on_inputs is false (a declaration, not verifiable by probing). Offerings without a data_policy are excluded."
    • changedInput schema / properties / steps / items / properties / select / properties / retention / description
      Previous value: -"Maximum data retention: \"none\" keeps offerings whose data_policy stores nothing beyond the request; \"ephemeral\" also allows bounded holding. Offerings without a data_policy are excluded."New value: +"Maximum data retention as the operator declares it in data_policy (a declaration: probing cannot verify it; data_policy.source links the published policy where the card gives one): \"none\" keeps offerings that declare storing nothing beyond the request; \"ephemeral\" also allows bounded holding. Offerings without a data_policy are excluded."
    • addedInput schema / properties / steps / items / properties / select / properties / server_check
      Added value: +{
      +  "description": "\"passed\": only offerings whose API server front the registry located in the operator's declared country or region (or, behind a CDN, every origin address the card declares). A network tripwire, not proof: a front that forwards requests elsewhere passes it. Each hosted result carries jurisdiction.server_check: passed | passed_origin | cdn | mismatch | inconsistent | unchecked.",
      +  "enum": [
      +    "passed",
      +    "any"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / steps / items / properties / select / properties / trust / description
      Previous value: -"\"trusted\": only the trusted pool, for personal data and sensitive work: operators in the registry's trusted jurisdictions (see /v0/health trust), declared lineage without CN, tier verified or higher, no retention and no training on inputs. \"open\" (or omitted): both pools. Each result carries pool: \"trusted\" or \"open\"."New value: +"\"trusted\": only the trusted pool, for personal data and sensitive work: operators that declare a country in the registry's trusted jurisdictions (see /v0/health trust) and whose server front passed the registry's location check, declared lineage without CN, tier verified or higher, a declared data policy of no retention and no training on inputs. \"open\" (or omitted): both pools. Each result carries pool: \"trusted\" or \"open\"."
  2. Changed5 schema fields changed
    • changedInput schema / properties / steps / items / properties / select / properties / exclude_lineage / description
      Previous value: -"Comma-separated ISO country codes; drops offerings whose declared model lineage includes any of them, e.g. \"CN\". Offerings that declare no lineage are kept."New value: +"Comma-separated ISO country codes; drops offerings whose declared model lineage includes any of them, e.g. \"CN\". Offerings that declare no lineage are kept unless lineage is \"declared\"."
    • addedInput schema / properties / steps / items / properties / select / properties / lineage
      Added value: +{
      +  "description": "\"declared\": drop offerings whose model declares no lineage (unknown origin is not clean). Combine with exclude_lineage for a strict origin policy.",
      +  "enum": [
      +    "declared",
      +    "any"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / steps / items / properties / select / properties / no_training
      Added value: +{
      +  "description": "true: only offerings whose data_policy says training_on_inputs is false. Offerings without a data_policy are excluded.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / steps / items / properties / select / properties / retention
      Added value: +{
      +  "description": "Maximum data retention: \"none\" keeps offerings whose data_policy stores nothing beyond the request; \"ephemeral\" also allows bounded holding. Offerings without a data_policy are excluded.",
      +  "enum": [
      +    "none",
      +    "ephemeral",
      +    "logged"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / steps / items / properties / select / properties / trust
      Added value: +{
      +  "description": "\"trusted\": only the trusted pool, for personal data and sensitive work: operators in the registry's trusted jurisdictions (see /v0/health trust), declared lineage without CN, tier verified or higher, no retention and no training on inputs. \"open\" (or omitted): both pools. Each result carries pool: \"trusted\" or \"open\".",
      +  "enum": [
      +    "trusted",
      +    "open"
      +  ],
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / steps / items / properties / select / properties / region / description
      Previous value: -"Data residency: every pinned region and every live serving site must lie inside this ISO 3166 code, e.g. \"CA\" (also matches \"CA-QC\") or \"EU\"."New value: +"Data residency: every pinned region and every live serving site must lie inside this ISO 3166 code, e.g. \"CA\" (also matches \"CA-QC\") or \"EU\" (also matches member states such as \"DE\"; \"EEA\" adds IS, LI, NO)."
  4. Changed3 schema fields changed
    • addedInput schema / properties / steps / items / properties / select / properties / exclude_lineage
      Added value: +{
      +  "description": "Comma-separated ISO country codes; drops offerings whose declared model lineage includes any of them, e.g. \"CN\". Offerings that declare no lineage are kept.",
      +  "type": "string"
      +}
    • addedInput schema / properties / steps / items / properties / select / properties / location_basis
      Added value: +{
      +  "description": "Minimum evidence for the serving locations: claimed < documented (the provider's own dated page) < measured (registry probes) < attested. Offerings without known locations are excluded.",
      +  "enum": [
      +    "claimed",
      +    "documented",
      +    "measured",
      +    "attested"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / steps / items / properties / select / properties / region
      Added value: +{
      +  "description": "Data residency: every pinned region and every live serving site must lie inside this ISO 3166 code, e.g. \"CA\" (also matches \"CA-QC\") or \"EU\".",
      +  "type": "string"
      +}
  5. Changed2 schema fields changed
    • addedInput schema / properties / steps / items / properties / select / properties / local
      Added value: +{
      +  "description": "true: only models that run on the user's own machine (the Ollama library: no server, free, ranked by Ollama pulls, with local.sizes_memory per size). false: only hosted offerings. Omit for both (hosted listed first). The result's counts give { hosted, local }.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / steps / items / properties / select / properties / memory_gb
      Added value: +{
      +  "description": "RAM/VRAM the user can give a local model, in GB: keeps local models with a size that fits (4-bit estimate). Hosted offerings are unaffected.",
      +  "minimum": 1,
      +  "type": "number"
      +}
  6. Changed1 schema field changed
    • changedInput schema / properties / steps / items / properties / select / properties / jurisdiction / description
      Previous value: -"Only operators that declare a country inside it: \"eea\" (EU + Iceland, Liechtenstein, Norway) or comma-separated ISO country codes, e.g. \"DE,FI\". Imported listings declare no country and are excluded."New value: +"Only operators that declare a country inside it: \"eea\" (EU + Iceland, Liechtenstein, Norway) or comma-separated ISO country codes, e.g. \"DE,FI\". Registered nodes declare their country; imported listings of known providers carry an inferred one (jurisdiction.basis = \"inferred\"); listings without a country are excluded."
  7. Changed1 schema field changed
    • addedInput schema / properties / steps / items / properties / select / properties / jurisdiction
      Added value: +{
      +  "description": "Only operators that declare a country inside it: \"eea\" (EU + Iceland, Liechtenstein, Norway) or comma-separated ISO country codes, e.g. \"DE,FI\". Imported listings declare no country and are excluded.",
      +  "type": "string"
      +}
  8. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, and the description reinforces this with "nothing is invoked or charged" while adding context the annotations cannot convey: results come back as per-step USD cost bounds, a pinned card_revision that makes the estimate enforceable at invocation, and chain totals. It does not say what happens when a `select` matches nothing (empty step vs. error), which is the remaining behavioral gap.

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, front-loaded with the key constraint ("BEFORE spending money"), then the input shape, then the return contract. No restatement of the title and no filler; every clause carries decision-relevant information.

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 carries the return contract and does so adequately (per-step bounds, pinned revision, chain totals). For a tool whose input schema is this rich, the remaining omissions are minor: no mention of the 20-step maximum or what a no-match `select` yields, so an agent cannot fully predict edge-case behavior.

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 description coverage is effectively 100%, so the baseline is 3, but the description earns a bump by summarizing the composite step shape at a glance: each step is either a concrete "node_id/offering_id" or a select query, plus expected input and output tokens. That makes the mutual exclusivity of `offering` and `select` readable without parsing the nested object, though it does not mention the 20-step cap or ordering semantics (which the schema carries).

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 ("Pre-price an invocation chain") and immediately distinguishes it from the discovery siblings by noting that `select` mirrors search_offerings but here it only produces estimates. The scope (per-step bounds, pinned card_revision, chain totals) plus "nothing is invoked or charged" makes the tool unmistakable versus recommend or get_offering.

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 when-to-use guidance: before spending money, to compare routes, or to budget a multi-model pipeline. It also clarifies the in-step choice between `offering` and `select`, which is the main decision an agent faces. It stops short of naming an explicit sibling to avoid (e.g. recommend) or stating when an estimate is unnecessary (single known offering), so it is strong but not a full when/when-not pair.

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.