Skip to main content

← Developer Docs

MCP Tool Reference

OnwardTicket.us exposes 6 tools over the Model Context Protocol SSE transport at https://onwardticket.us/api/mcp. 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.

Contents

list_services

List the three onward-ticket service offerings (flight-itinerary, hotel-reservation, visa-essentials) with current base prices in USD, descriptions, supported routes, and add-ons. No arguments required.

Inputs

No input parameters.

Example request (JSON-RPC over SSE)

{
  "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 price quote for a service. Returns total, per-line breakdown, and currency. Does NOT create an order — call this before asking the user to commit to checkout.

Inputs

serviceKeystring · required · enum: flight-itinerary | hotel-reservation | visa-essentials
Service identifier — one of 'flight-itinerary', 'hotel-reservation', 'visa-essentials'. Use list_services to discover available keys.
flightRoutestring · optional · enum: oneway | return | multicity
For flight-itinerary only — 'oneway' (default), 'return', or 'multicity'. Adds the corresponding route surcharge per traveler; for multicity the surcharge is PER LEG — pass `legs`.
urgencystring · optional · enum: | urgent | superfast
Speed tier — '' or omitted = standard (4h delivery), 'urgent' (30min), 'superfast' (5min). Add-on cost varies by service.
travelersinteger · optional
Number of travelers, 1-7. Default 1.
legsinteger · optional
Multi-city only: number of flight legs. The multi-city surcharge is charged PER LEG. Default 1.
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'. Falls back to USD if no override exists for this service+currency.

Example request (JSON-RPC over SSE)

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

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"serviceKey\": \"flight-itinerary\",\n  \"currency\": \"USD\",\n  \"travelers\": 2,\n  \"total\": 28.46,\n  \"deliveryEstimate\": \"within 5 minutes after payment\"\n}"
      }
    ],
    "structuredContent": {
      "serviceKey": "flight-itinerary",
      "currency": "USD",
      "travelers": 2,
      "total": 28.46,
      "deliveryEstimate": "within 5 minutes after payment"
    }
  }
}

place_order

Create a pending order and return a Stripe Checkout URL. Agent should display the URL to the user — payment happens in the user's browser. Returns the URL, expected total in major units, currency, and an order/cart reference id. Re-derives the price server-side; agent-supplied prices are ignored.

Inputs

serviceKeystring · required · enum: flight-itinerary | hotel-reservation | visa-essentials
Service identifier — one of 'flight-itinerary', 'hotel-reservation', 'visa-essentials'. Use list_services to discover available keys.
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'. Adds the corresponding route surcharge per traveler; for multicity the surcharge is PER LEG — pass `legs`.
urgencystring · optional · enum: | urgent | superfast
Speed tier — '' or omitted = standard (4h delivery), 'urgent' (30min), 'superfast' (5min). Add-on cost varies by service.
travelersinteger · optional
Number of travelers, 1-7. Default 1.
legsinteger · optional
Multi-city only: number of flight legs. The multi-city surcharge is charged PER LEG. Default 1.
currencystring · optional
ISO 4217 currency code (3 letters, uppercase). Default 'USD'. Falls back to USD if no override exists for this service+currency.
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.

Example request (JSON-RPC over SSE)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "place_order",
    "arguments": {
      "serviceKey": "flight-itinerary",
      "email": "[email protected]",
      "flightRoute": "return",
      "travelers": 2,
      "fromIata": "DXB",
      "toIata": "BKK",
      "departureDate": "2026-06-01"
    }
  }
}

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\": 28.46,\n  \"currency\": \"USD\",\n  \"expiresAt\": \"2026-06-01T12: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": 28.46,
      "currency": "USD",
      "expiresAt": "2026-06-01T12: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 SSE)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "lookup_order",
    "arguments": {
      "orderNumber": "OT-2026-12345",
      "email": "[email protected]"
    }
  }
}

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"orderNumber\": \"OT-2026-12345\",\n  \"status\": \"completed\",\n  \"deliveredAt\": \"2026-04-26T10:00:00.000Z\",\n  \"downloads\": [\n    \"https://onwardticket.us/files/...\"\n  ]\n}"
      }
    ],
    "structuredContent": {
      "orderNumber": "OT-2026-12345",
      "status": "completed",
      "deliveredAt": "2026-04-26T10:00:00.000Z",
      "downloads": [
        "https://onwardticket.us/files/..."
      ]
    }
  }
}

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 SSE)

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

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"results\": [\n    {\n      \"slug\": \"thailand-visa\",\n      \"title\": \"...\",\n      \"excerpt\": \"...\"\n    }\n  ]\n}"
      }
    ],
    "structuredContent": {
      "results": [
        {
          "slug": "thailand-visa",
          "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 SSE)

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

Example response

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

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