Skip to main content
Glama

dispatch

Send a text chat request through the dispatch gateway: it applies your policy, runs the best eligible model, and returns the completion, usage and the full dispatch_receipt (chosen model, reason, cost, savings, attempts) — the same as POST /v1/chat/completions with a dispatch object. This makes a REAL model call billed to your own provider keys stored for your org (POST /dispatch/keys), and the spend is recorded against your org. Requires your service API key on the MCP connection (x-api-key or Authorization: Bearer); the operator key and anonymous callers get dispatch_requires_api_key, and the local STDIO server refuses with dispatch_requires_hosted_mcp. Pass prompt (with optional system) or messages, not both. Text-only, single-choice, non-streaming; no tools/functions. Refusals carry the same error codes as HTTP. Calls can take a while with failover: bound them with dispatch.failover.timeout_ms and dispatch.failover.max_attempts, and set LLM_PRICING_MCP_TIMEOUT_MS=120000 when using the npx bridge.

Input Schema

NameRequiredDescriptionDefault
stopNoStop sequence or list of stop sequences
modelNoRequested model name (default 'auto'); the policy decides what runs
top_pNoNucleus sampling
promptNoThe user prompt (use this or messages, not both)
systemNoOptional system prompt, only with prompt
dispatchNoDispatch policy — the same object as the HTTP `dispatch` body field (OpenAI SDK extra_body={'dispatch': {...}}). Omit for the balanced objective with failover on.
messagesNoOpenAI-style chat messages (use this or prompt, not both)
max_tokensNoMax completion tokens (server default when omitted)
temperatureNoSampling temperature

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?

With no annotations, the description carries the full burden and does so thoroughly: it discloses real spend to the caller's provider keys, org-level billing, required auth (x-api-key / Bearer), specific failure codes (dispatch_requires_api_key, dispatch_requires_hosted_mcp), refusal parity with HTTP, and non-streaming/text-only limits. It also warns about latency with failover and names the exact knobs (failover.timeout_ms, max_attempts, LLM_PRICING_MCP_TIMEOUT_MS) to bound it.

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 what the tool does and what it returns before drilling into auth and limits, and nearly every sentence carries operational information. It is dense and long — the final npx-bridge timeout sentence is crammed in and slightly reads as an appendix — but no sentence is pure 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 paid, network-bound, policy-driven tool with no annotations and no output schema, the description supplies everything an agent needs before calling: cost implications, credential requirements, return payload shape, and latency-control parameters. Nothing critical is left to inference, and the receipt contents are enumerated so a missing output schema is not a gap.

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 value: the prompt-vs-messages mutual exclusivity, 'system' only valid with prompt, and the key default that omitting `dispatch` yields the balanced objective with failover on. The nested dispatch object also gains the pointer that it is identical to the HTTP body field. It stops short of explaining tradeoffs among objectives or the shadow behavior beyond what the schema states.

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+resource ('Send a text chat request through the dispatch gateway'), then explains the mechanism (policy -> best eligible model) and the exact return payload (completion, usage, dispatch_receipt with chosen model/reason/cost/savings/attempts). It also anchors the tool to its HTTP equivalent (POST /v1/chat/completions with a `dispatch` object), which immediately separates it from the read-only pricing/analytics siblings like estimate_cost or compare_costs.

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 use conditions ('This makes a REAL model call billed to your own provider keys') that implicitly route estimation/analysis work to the sibling cost tools, plus explicit exclusions ('Text-only, single-choice, non-streaming; no tools/functions'). It does not name any sibling tool by name or state a when-not against a specific alternative, which keeps it short of a 5.

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.