エージェントとMCP
AIエージェントをレストランに接続する。
Tablezio は Model Context Protocol に対応しています。API キーを使うと、Claude・Cursor・ChatGPT 上のエージェントが 1 店舗の予約・メニュー・注文・在庫・売上に対する 14 のツールを利用できます。範囲はキーのスコープ、プラン、契約中のモジュールで制限されます。
What it is
One MCP endpoint, two modes. The Bearer token is optional: without it you get the public, read-only tools; with it you get the restaurant that owns the key, and only that restaurant.
- Remote, over Streamable HTTP: POST https://api.tablezio.com/mcp, stateless, no session to keep.
- Either way the key is the tenant: an agent can never read or write another restaurant’s data.
When a client lists the tools, the server returns only the ones the key’s scopes, plan and contracted modules allow. get_account is always there: it is how an agent finds out what it may do and why it may not do more.
Install
Create a key in Tablezio › Settings › API keys and agents and point your client at https://api.tablezio.com/mcp with the key in an Authorization: Bearer header. Clients whose connector screen only asks for a URL need no key at all: see the OAuth connector below.
Claude Desktop
Add Tablezio as a custom connector (Settings › Connectors › Add custom connector) with the URL https://api.tablezio.com/mcp. Claude Desktop signs in through the OAuth flow described below, so there is no key to paste.
Claude Code
claude mcp add --transport http tablezio https://api.tablezio.com/mcp \
--header "Authorization: Bearer tbz_test_..."Cursor
{
"mcpServers": {
"tablezio": {
"url": "https://api.tablezio.com/mcp",
"headers": { "Authorization": "Bearer tbz_test_..." }
}
}
}ChatGPT and other remote clients
ChatGPT adds Tablezio as a remote MCP connector: either with the URL alone (OAuth, below) or pointing at the endpoint with the key in the Authorization header. Any client that supports remote MCP takes the same shape.
{
"mcpServers": {
"tablezio": {
"type": "http",
"url": "https://api.tablezio.com/mcp",
"headers": { "Authorization": "Bearer tbz_live_..." }
}
}
}Remote connector (OAuth 2.1)
Claude.ai and ChatGPT’s "Add connector" screen only asks for a URL — no key, no header to type. Pasting https://api.tablezio.com/mcp there runs the whole OAuth 2.1 dance for you: discovery, dynamic client registration and a consent screen in the Tablezio dashboard, instead of copying a key into a config file.
- In the client, add a remote connector with the URL https://api.tablezio.com/mcp. Nothing else to fill in.
- It reads /.well-known/oauth-protected-resource (RFC 9728) and /.well-known/oauth-authorization-server (RFC 8414), then registers itself with POST /oauth/register (RFC 7591) — a public client, no secret.
- It opens /oauth/authorize with PKCE (S256). You sign in to the Tablezio dashboard and land on a consent screen that names the connector and lists the scopes it is asking for in plain language.
- Granting access returns a one-time code, which the connector exchanges at POST /oauth/token for an access token (tbz_oat_…) and a refresh token.
- From then on every call carries that token with the same scopes, plan and cost limits as an API key — nothing in the tools or the rest of this page changes.
- Revoke it anytime from Settings › API keys and agents › Connected apps, or disconnect it inside Claude.ai/ChatGPT — both call POST /oauth/revoke (RFC 7009).
The static Authorization: Bearer header above still works — OAuth is only for clients whose connector flow supports it.
Tools
Every tool declares the scope it needs, the module it belongs to and the weighted cost units a call is charged. A tool whose scope or module the key does not have is never registered, so an agent cannot call it by mistake.
| Tool | スコープ | Module | Cost | What it does |
|---|---|---|---|---|
get_account | — | — | 0 | Restaurant, plan, the key’s scopes, whether it is a test key, and the remaining allowance. Call it first. |
get_service_snapshot | analytics:read | analytics | 5 | How service is going right now: today’s sales, average ticket, occupied tables, open orders. |
get_sales_report | analytics:read | analytics | 5 | Sales for a period (92 days max): revenue, orders, average ticket, peak hours, best and worst sellers. |
list_reservations | reservations:read | reservations | 1 | Reservations for a day or range, filterable by status: time, party size, name, state. |
check_availability | reservations:read | reservations | 1 | Free slots for a date and party size. Call it before creating or moving a reservation. |
create_reservation | reservations:write | reservations | 10 | Creates a reservation (date, time, party, name, phone or email, notes) and can notify the guest. |
update_reservation | reservations:write | reservations | 5 | Changes time, party size, table or notes, or the status (confirmed, seated, completed, no_show). |
cancel_reservation | reservations:write | reservations | 5 | Cancels a reservation and notifies the guest. Irreversible, so it requires confirm: true. |
search_menu | menu:read | menu | 1 | Finds menu items by text or category: price, availability (86’d or not), allergens, category. |
set_item_availability | menu:write | menu | 2 | Marks an item as sold out (86) or puts it back on the menu. |
update_item_price | menu:write | menu | 2 | Changes an item’s price. Rejects moves of more than 50% unless confirm: true. |
list_orders | orders:read | core | 1 | Orders by status, type or table: table, total, summarised lines, state. Defaults to open orders (not completed or cancelled); pass an exact status or "all". |
get_low_stock | inventory:read | inventory | 2 | Inventory items below their minimum, with stock, unit and minimum. |
record_stock_movement | inventory:write | inventory | 2 | Records a receipt, issue, waste or adjustment against an inventory item. |
Scopes and presets
Keys carry granular resource:action scopes. Instead of ticking them one by one you can mint a key from a preset.
| Preset | Grants | Use it for |
|---|---|---|
read | analytics:read, customers:read, events:read, inventory:read, loyalty:read, menu:read, orders:read, reports:read, reservations:read, webhooks:read | Dashboards, reporting agents, anything that must not change data. |
write | every :read scope + reservations:write, menu:write, inventory:write, orders:write, customers:write | The day-to-day agent: book, move, 86 an item, record stock. |
full | every scope in the whitelist (adds loyalty:write, reports:write, webhooks:write) | Integrations that also manage webhooks, loyalty and reports. |
There is no wildcard preset: * can only be granted by an operator, never over HTTP. Give each agent its own key with the narrowest preset that works — keys are revoked individually.
Test and live
- tbz_test_… — reads are real, writes are simulated. Nothing reaches the floor and no guest is notified: this is the key you build and demo an agent with.
- tbz_live_… — everything is real, on the restaurant’s live data.
- Irreversible actions (cancelling a reservation, moving a price by more than 50%) additionally require an explicit confirm: true, in both environments.
Cost and limits
Limits are measured in weighted cost units, not calls: a simple read costs 1, creating a reservation costs 10 (see the Cost column above). Per-minute and concurrency limits are per key; the daily and monthly allowances are per restaurant.
| Plan | Key environments | Keys | Units/min | Units/day | Units/month |
|---|---|---|---|---|---|
| Free | test only | 1 | 20 | 300 | — |
| Basic | test only | 1 | 20 | 300 | — |
| Pro | test + live | 5 | 120 | 5,000 | 50,000 |
Plans without live access can still wire an agent up and watch it work with a test key. Enterprise limits are agreed case by case.
Errors
Three failures are specific to agents. All three say what to do next, so an agent can explain itself instead of retrying blindly.
HTTP/1.1 403 Forbidden
{
"message": "Your Basic plan does not include live API access — use a tbz_test_ key or upgrade to Pro at https://app.tablezio.com/billing",
"code": "LIVE_API_ACCESS_DENIED",
"details": {
"planKey": "basic",
"environment": "live",
"upgradePlan": "pro",
"upgradeUrl": "https://app.tablezio.com/billing"
}
}HTTP/1.1 403 Forbidden
{
"message": "Your plan does not include the Inventory module — add it from https://app.tablezio.com/billing",
"code": "PACK_NOT_INCLUDED",
"details": { "pack": "inventory", "upgradeUrl": "https://app.tablezio.com/billing" }
}HTTP/1.1 429 Too Many Requests
Retry-After: 24
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Has superado el límite de 120 unidades por minuto…"
}
}A 429 always carries Retry-After in seconds: wait that long, then retry once. The full envelope, status codes and error types are on エラー.
Reference
Every tool is a thin wrapper over the versioned REST API, so anything an agent can do you can do yourself over HTTP: