Skip to main content
Glama

Buy onward ticket

buy_ticket
Idempotent

Buy the ticket for a flight from search_flights, paid in USDC. Call it first without payment to get the price, wallet address and MPP challenges. After sending the USDC, call it again with tx_hash and chain (or an MPP credential in _meta "org.paymentauth/credential"). x402 clients can instead sign one of the offers in error.data.x402 and retry with the PaymentPayload in _meta "x402/payment", with no gas needed. Returns the ticket link and PDF.

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": {
      "ticket_id": "<ticket_id>",
      "first_name": "<first_name>",
      "last_name": "<last_name>"
    },
    "name": "buy_ticket"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainNoChain the USDC was sent on, defaults to base
emailNoOptional, also emails the ticket here
tx_hashNoHash of the USDC transfer that paid for it
last_nameYesPassenger's last name, as on their passport
ticket_idYesThe flight id from search_flights
first_nameYesPassenger's first name, as on their passport
coupon_codeNoOptional coupon code

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / coupon_code
      Added value: +{
      +  "description": "Optional coupon code",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare the generic profile (not read-only, open-world, idempotent, non-destructive); the description adds the substantive behavior: a payment-gated two-phase flow, the three payment mechanisms (direct USDC, MPP credential, x402 payload), and the fact that x402 needs no gas. It also discloses return values (ticket link and PDF), which no output schema provides. Nothing here contradicts the idempotentHint, since re-calling with the same tx_hash is the intended safe pattern.

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, all front-loaded: purpose and currency first, then the free price-check call, then the paid retry, then the x402 variant. Every sentence carries operational information – no restatement of the title or filler – and the optional paths are cleanly subordinated with 'or' and 'instead'.

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 mutation with no output schema, the description covers what an agent needs: prerequisite tool, the mandatory two-call sequence, all three payment routes, extra out-of-band input locations (_meta keys), and the shape of the return (link plus PDF). No material gap remains for correct invocation.

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 per-field documentation is already handled and baseline is 3. The description goes beyond it by explaining the temporal relationship between the required identity fields and the optional tx_hash/chain pair (they only apply on the post-payment call) and by introducing a non-schema input channel, the _meta credential/payment payload keys, which the parameter list does not show at all.

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 opening sentence states a specific verb and resource ('Buy the ticket for a flight') and anchors the input to the sibling tool ('from search_flights'). It also names the payment currency (USDC), so an agent immediately understands this is a paid purchase step distinct from search_flights or find_airports.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives an explicit two-pass protocol: call first with no payment to obtain price, wallet address and MPP challenges, then call again with tx_hash and chain after sending USDC. It also states a concrete alternative path for x402 clients (sign an offer from error.data.x402 and retry with PaymentPayload in _meta). When-to-use and how-to-sequence are both spelled out rather than inferred.

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