Skip to main content
The complete contract for Phantom’s MCP tool surface — every tool, its inputs, outputs, and behavior rules. For credentials, authentication, rate limits, and the canonical order flow, start with Agent Onboarding. Every tool goes through the same service methods, scope checks, and rule validation — there is no separate ordering logic behind any surface. Endpoint: POST https://phantom.mealops.ai/mcp (Streamable HTTP), authenticated with Authorization: Bearer <agent-api-key>.

Tool list

The MCP server registers 20 tools. The list is scope-filtered per credential: tools your key lacks the scope for are not registered at all (a discovery-only key — restaurants:read + menus:read — sees 9 tools instead of the full 20). The filter mirrors call-time enforcement exactly, including the orders:submit → payments:start implication. Calling a tool your key can’t see returns the MCP “tool not found” error — if a tool seems missing, check your key’s scopes. Scope upgrades apply on the next request, no reconnect needed. Some restaurants deliver only to a registered delivery address. When capabilities.addresses is provider_saved, pick the dropoff from list_saved_addresses, or register one with find_address_candidates + save_delivery_address. Otherwise these three address-book tools return an error. See Discovery. All output schemas are strict (additionalProperties: false): a field not declared in a tool’s output schema is never passed through.

Capabilities

Restaurants don’t all answer every question the same way: some publish no opening hours, some deliver only to a registered delivery address, some price orders with their own itemized charges. Rather than guessing, read the capabilities block. It rides once on every search_restaurants envelope and on every get_restaurant_detail response:
The block can carry other informational fields; clients can ignore them. A response without the block comes from an older Phantom: assume the first value listed for each field.

Freshness

Agent listings always reflect the latest writes — results are never served from a stale cache. Menus read by search_menu_items may be up to 30 seconds stale, and every menu write invalidates that cache immediately. For most restaurants, get_menu, validation, and quoting are never cached — they see availability flips instantly. Menus for some restaurants may be a few minutes old; validation and quoting always check live, so a sold-out item or a store that just closed is caught there.

Ownership and access

Order tools (get_order_status, get_order_tracking, cancel_order, update_order) enforce ownership: an agent may only touch orders it created. Foreign and missing orders both return Order <id> not found., so order ids are not enumerable across agents. The payment tools apply the same rule to payment references. Restaurant-side tools enforce only that the restaurant is live (ordering enabled, payout ready) — there are no per-restaurant agent permissions; approval is platform-wide. Two tools carry their own per-agent cap on top of the shared quota, because one call costs far more than one call’s worth of work: search_menu_items (60/min — up to 25 menus scanned) and check_delivery_availability (60/min — each call is a live courier request). The budgets are independent: exhausting one leaves the other untouched.

Errors

A refused call comes back as an MCP tool error whose text is the error message — Phantom’s internal error code is not a separate field. Messages are written to be relayed to a person. Where a client has to branch on the kind of refusal, the message carries a machine-readable tag you can match exactly: The full list of refusals, tagged or not, is in Ordering and Rules that vary by restaurant.

Canonical behavior rules

  • Authorization always stays server-side; a client can never widen its own scopes.
  • Identity is stamped, never trusted: order.agent_id is optional and filled in from your API key. Send a different one and the call throws.
  • Payment always runs after quote and before submit — every order is prepaid, and the hold must cover the order at submit and after any edit that re-prices it.
  • All POS providers stay behind the same tool contract — clients never see provider-specific ordering logic. Where restaurants genuinely differ, it is declared in capabilities; branch on that, never on restaurant ids.
  • An input that cannot be honored is an error, not a silent default: contradictory availability flags (open_now + requested_time), a half-supplied coordinate pair, and radius_miles without an origin all throw rather than returning a plausible answer to a different question.
  • Prefer server-resolved values (resolvedMinLeadTimeMinutes, earliest_orderable_time, the quote total, check_delivery_availability) over recomputing them; fall back to components only for compatibility with an older Phantom.