Skip to main content

← Developer Docs

MCP Tool Reference

OnwardTicket.us exposes 6 tools over the Model Context Protocol Streamable HTTP transport at https://onwardticket.us/api/mcp (with legacy SSE fallback available at /api/mcp/sse). Each section below shows the input schema, an example JSON-RPC tools/call body, and the shape of the response. Tool definitions are re-fetched from /.well-known/mcp/server-card.json every 10 minutes. Read-only discovery, quoting, lookup, and blog tools are public with no authentication; place_order operates in dual mode so public AI / ChatGPT users can mint an unpaid Stripe Checkout checkoutUrl under guest limits, while partners can pass a Partner API Key (X-API-Key or Authorization: Bearer) issued via /b2b/apply for higher quota.

Contents

list_services

List the onward-ticket service offering (flight-itinerary) with its current base price in USD, description, supported routes, and add-ons. No arguments required.

Inputs

No input parameters.

Example request (JSON-RPC over Streamable HTTP)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_services",
    "arguments": {}
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"services\": [\n    {\n      \"key\": \"flight-itinerary\",\n      \"basePrice\": 7,\n      \"currency\": \"USD\"\n    },\n    \"...\"\n  ]\n}"
      }
    ],
    "structuredContent": {
      "services": [
        {
          "key": "flight-itinerary",
          "basePrice": 7,
          "currency": "USD"
        },
        "..."
      ]
    }
  }
}

quote_order

Compute a server-authoritative price quote for a service (step 3 of the 9-step customer consent flow: 1. discover via list_services -> 2. collect journey details -> 3. quote via quote_order -> 4. present total, delivery estimate, and validity terms (48h standard or 7-day add-on) -> 5. obtain explicit customer confirmation -> 6. create unpaid order via place_order -> 7. present checkoutUrl -> 8. customer authorizes payment in browser -> 9. check status via lookup_order). Returns total, subtotal, currency, and deliveryEstimate. Does NOT create an order or charge the customer.

Inputs

serviceKeystring · required · enum: flight-itinerary
Service identifier. Onward sells flight itineraries only, so this is always 'flight-itinerary'. Use list_services to confirm.
flightRoutestring · optional · enum: oneway | return | multicity
For flight-itinerary only — 'oneway' (default), 'return', or 'multicity'. Per traveler: one-way is the base price; return is base + the return surcharge; multicity is priced PER LEG with NO base fee (e.g. $9 x legs) — pass `legs`.
urgencystring · optional · enum: | instant
Speed tier — '' or omitted = standard (14h delivery), 'instant' (2-20min). Add-on cost varies by service.
travelersinteger · optional
Number of travelers, 1-9. Default 1.
legsinteger · optional
Multi-city only (required for multicity): number of flight legs, 2 or more. Multi-city is priced PER LEG per traveler with no base fee.
pnrValiditystring · optional · enum: 48h | 7d
Optional PNR validity period: '48h' (standard up to 48 hours, included) or '7d' (extended 7-day validity add-on, +$8 flat per order). Defaults to '48h'.
extendedValidityboolean · optional
Alias for pnrValidity='7d'. When true, adds the 7-day validity add-on (+$8 flat per order).
couponCodestring · optional
Optional discount code. Validated server-side; an invalid code returns an error rather than silently ignoring it.
currencystring · optional
ISO 4217 currency code (3 letters, uppercase). Default 'USD'. Converted via live FX rates (or configured service override), falling back to USD if the currency rate or Stripe presentment is unavailable.
originstring · optional
Optional departure airport IATA code or city for quote context (pricing is route-agnostic).
destinationstring · optional
Optional arrival airport IATA code or city for quote context (pricing is route-agnostic).
departureDatestring · optional
Optional outbound date (YYYY-MM-DD) for quote context.

Example request (JSON-RPC over Streamable HTTP)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "quote_order",
    "arguments": {
      "serviceKey": "flight-itinerary",
      "flightRoute": "return",
      "urgency": "instant",
      "travelers": 2,
      "currency": "USD"
    }
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"serviceKey\": \"flight-itinerary\",\n  \"flightRoute\": \"return\",\n  \"urgency\": \"instant\",\n  \"travelers\": 2,\n  \"currency\": \"USD\",\n  \"subtotal\": 32,\n  \"total\": 32,\n  \"deliveryEstimate\": \"up to 2-20 minutes after payment\"\n}"
      }
    ],
    "structuredContent": {
      "serviceKey": "flight-itinerary",
      "flightRoute": "return",
      "urgency": "instant",
      "travelers": 2,
      "currency": "USD",
      "subtotal": 32,
      "total": 32,
      "deliveryEstimate": "up to 2-20 minutes after payment"
    }
  }
}

place_order

Create a pending, UNPAID order and return a Stripe Checkout URL (step 6 of the 9-step customer consent flow; call ONLY after quoting via quote_order, presenting the total price, delivery estimate, and validity terms, and receiving explicit customer confirmation). NEVER charges the customer directly — the human customer must open checkoutUrl in their browser to review and authorize payment. Returns checkoutUrl, expected total in major units, currency, deliveryEstimate, validity terms, echo of stored passenger/itinerary details, and pendingOrderId. Re-derives the price server-side; agent-supplied prices are ignored.

Inputs

serviceKeystring · required · enum: flight-itinerary
Service identifier. Onward sells flight itineraries only, so this is always 'flight-itinerary'. Use list_services to confirm.
emailstring · required
Booking email — receipts and the booking PDF are sent here after payment. Required.
flightRoutestring · optional · enum: oneway | return | multicity
For flight-itinerary only — 'oneway' (default), 'return', or 'multicity'. Per traveler: one-way is the base price; return is base + the return surcharge; multicity is priced PER LEG with NO base fee (e.g. $9 x legs) — pass `legs`.
urgencystring · optional · enum: | instant
Speed tier — '' or omitted = standard (14h delivery), 'instant' (2-20min). Add-on cost varies by service.
travelersinteger · optional
Number of travelers, 1-9. Default 1.
legsinteger · optional
Multi-city only (required for multicity): number of flight legs, 2 or more. Multi-city is priced PER LEG per traveler with no base fee.
pnrValiditystring · optional · enum: 48h | 7d
Optional PNR validity period: '48h' (standard up to 48 hours, included) or '7d' (extended 7-day validity add-on, +$8 flat per order). Defaults to '48h'.
extendedValidityboolean · optional
Alias for pnrValidity='7d'. When true, adds the 7-day validity add-on (+$8 flat per order).
currencystring · optional
ISO 4217 currency code (3 letters, uppercase). Default 'USD'. Converted via live FX rates (or configured service override), falling back to USD if the currency rate or Stripe presentment is unavailable.
couponCodestring · optional
Optional discount code. Validated server-side; an invalid code returns an error rather than silently ignoring it.
fromIatastring · optional
Departure airport IATA code (3 uppercase letters). Flight only.
toIatastring · optional
Arrival airport IATA code (3 uppercase letters). Flight only.
departureDatestring · optional
Outbound date in ISO YYYY-MM-DD.
returnDatestring · optional
Return date in ISO YYYY-MM-DD. Round-trip flights only.
namestring · optional
Primary traveler full name. Max 120 chars. Ignored when travelerDetails is supplied.
travelerDetailsarray · optional
Per-traveler identity, one entry per traveler, in order. REQUIRED when travelers > 1 — the booking document names each passenger, so an order for N travelers cannot be fulfilled with fewer than N names. For a single traveler this may be omitted and `name` used instead.
phonestring · optional
Contact phone in E.164 form (for WhatsApp updates / urgent contact). Max 40 chars.
idempotencyKeystring · optional
Optional caller-supplied idempotency key (max 128 chars) to safely retry a Checkout Session without colliding across distinct bookings.

Example request (JSON-RPC over Streamable HTTP)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "place_order",
    "arguments": {
      "serviceKey": "flight-itinerary",
      "email": "traveler@example.com",
      "flightRoute": "return",
      "travelers": 2,
      "fromIata": "DXB",
      "toIata": "BKK",
      "departureDate": "2027-01-15"
    }
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"pendingOrderId\": \"cart_id_string\",\n  \"checkoutUrl\": \"https://checkout.stripe.com/c/pay/cs_live_...\",\n  \"total\": 22,\n  \"currency\": \"USD\",\n  \"expiresAt\": \"2027-01-15T12:30:00.000Z\",\n  \"instruction\": \"Show the checkout URL to the user...\"\n}"
      }
    ],
    "structuredContent": {
      "pendingOrderId": "cart_id_string",
      "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_live_...",
      "total": 22,
      "currency": "USD",
      "expiresAt": "2027-01-15T12:30:00.000Z",
      "instruction": "Show the checkout URL to the user..."
    }
  }
}

lookup_order

Look up a placed order by its order number (e.g. OT-12345) and the booking email. Returns status, service, amount, currency, and the customer-facing tracking URL. Both arguments are required — they jointly act as the credential.

Inputs

orderIdstring · required
Order number printed on the receipt, e.g. OT-12345. The alias `orderNumber` is also accepted.
orderNumberstring · optional
Alias for `orderId`. Either may be supplied; supply only one.
emailstring · required
Email address used at checkout. Must match the order.

Example request (JSON-RPC over Streamable HTTP)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "lookup_order",
    "arguments": {
      "orderId": "OT-2026-12345",
      "email": "traveler@example.com"
    }
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"orderNumber\": \"OT-2026-12345\",\n  \"status\": \"delivered\",\n  \"service\": \"Onward Ticket\",\n  \"amount\": 11,\n  \"currency\": \"USD\",\n  \"createdAt\": \"2026-04-26T09:45:00.000Z\",\n  \"updatedAt\": \"2026-04-26T10:00:00.000Z\",\n  \"trackingUrl\": \"https://onwardticket.us/track?orderId=OT-2026-12345&email=traveler%40example.com\"\n}"
      }
    ],
    "structuredContent": {
      "orderNumber": "OT-2026-12345",
      "status": "delivered",
      "service": "Onward Ticket",
      "amount": 11,
      "currency": "USD",
      "createdAt": "2026-04-26T09:45:00.000Z",
      "updatedAt": "2026-04-26T10:00:00.000Z",
      "trackingUrl": "https://onwardticket.us/track?orderId=OT-2026-12345&email=traveler%40example.com"
    }
  }
}

search_blogs

Full-text search the public blog index. Returns up to `limit` matching posts (default 5, max 20) with title, excerpt, slug, and absolute URL — agents use this to ground answers about onward-ticket / visa-policy / travel-document questions.

Inputs

querystring · required
Free-text search query — matched against title and excerpt.
limitinteger · optional
Max results, default 5, max 20.

Example request (JSON-RPC over Streamable HTTP)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_blogs",
    "arguments": {
      "query": "onward ticket thailand",
      "limit": 5
    }
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"query\": \"onward ticket thailand\",\n  \"count\": 1,\n  \"results\": [\n    {\n      \"slug\": \"onward-ticket-thailand\",\n      \"title\": \"...\",\n      \"excerpt\": \"...\"\n    }\n  ]\n}"
      }
    ],
    "structuredContent": {
      "query": "onward ticket thailand",
      "count": 1,
      "results": [
        {
          "slug": "onward-ticket-thailand",
          "title": "...",
          "excerpt": "..."
        }
      ]
    }
  }
}

get_blog_post

Fetch the full body of a published blog post by slug, returned as agent-ingestible markdown (NOT HTML). Includes title, date, author, hero image URL, and the converted body.

Inputs

slugstring · required
URL slug of the post, e.g. "visa-policy-thailand-2026".

Example request (JSON-RPC over Streamable HTTP)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_blog_post",
    "arguments": {
      "slug": "onward-ticket-thailand"
    }
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"slug\": \"onward-ticket-thailand\",\n  \"title\": \"...\",\n  \"body\": \"# Heading\\n...\"\n}"
      }
    ],
    "structuredContent": {
      "slug": "onward-ticket-thailand",
      "title": "...",
      "body": "# Heading\n..."
    }
  }
}

Want to try these tools live? See the interactive playground.