WebMCP Tools Reference
A storefront can expose Model Context Protocol (MCP) tools at /v1/mcp so agents can shop natively. This chapter is for merchants who expose tools and agent developers who call them. Check GET /v1/mcp on a merchant for exactly what it offers.
Two request styles exist.
Style 1: JSON-RPC 2.0 (reference storefront)
# List tools and their schemas
curl -X POST https://<merchant-host>/v1/mcp -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# Call a tool: the tool name is the method
curl -X POST https://<merchant-host>/v1/mcp -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"search_catalog","params":{"query":"headphones","maxPrice":150}}'
mcp.list_tools is accepted as an alias for tools/list. Errors use JSON-RPC error objects (-32600 invalid request, -32603 internal error).
| Tool | Required parameters | Purpose |
|---|---|---|
search_catalog | none (query, vertical, maxPrice optional) | Search by keyword, vertical (groceries, tech, hotel), and maximum price in dollars. |
get_product | id | Full specs, stock, variants and pricing for a product ID or handle. |
add_to_cart | productId, quantity | Add an item. cartId optional (a new cart is created if omitted); variantId optional; hotel stays take checkIn / checkOut (YYYY-MM-DD). |
get_cart | cartId | Cart contents, breakdown and subtotal/tax. |
confirm_order | cartId, transactionId | Confirm fulfillment only after the merchant matches the order with the processor confirmation it requires. |
Style 2: Tool-call envelope with consent tiers
curl -X POST https://<merchant-host>/v1/mcp -H "Content-Type: application/json" \
-d '{"toolName":"search_catalog","arguments":{"query":"headphones"}}'
Tools come in three tiers:
| Tier | Tools | Gate |
|---|---|---|
| Answer | search_catalog, get_product, search_shop_policies_and_faqs | None |
| Act | get_cart, update_cart, cancel_cart, browse_store, show_variant, manage_orders | None |
| Transact | create_checkout, transact, execute_payment | Requires sessionConsentToken |
Transact-tier call:
{ "toolName": "execute_payment", "arguments": { "sessionId": "sess_…" }, "sessionConsentToken": "ctok.…" }
Responses
{ "success": true, "toolName": "search_catalog", "result": { "status": "EXECUTED", "scope": "ANSWER", "data": { … } } }
{ "success": false, "toolName": "execute_payment", "error": { "code": "USER_CONFIRMATION_REQUIRED", "message": "…" } }
error.code | HTTP | Meaning |
|---|---|---|
USER_CONFIRMATION_REQUIRED | 403 | Missing, invalid, expired, mismatched or already-used consent token. |
INVALID_ARGUMENTS | 400 | arguments is missing or not a JSON object. |
UNKNOWN_TOOL | 400 | The tool is not registered. |
Consent tokens
A transact-tier tool needs proof that a human approved this purchase.
- Tokens look like
ctok.<payload>.<signature>and are bound to onesessionId. - A token is valid for 5 minutes and works once.
- The
sessionIdinargumentsmust match the one the token was issued for. - Agents must obtain the token from the human's approval step. Never create, cache or reuse one.
- Static test strings (for example
valid-user-consent-token) are rejected. Only signed, single-usectok.…tokens are accepted. - In production IXOPAY configures the consent-signing secret for your account, and the service refuses consent tokens if it is missing (see Account Configuration).
Recommended purchase flow
- Discover: read the manifest, call
tools/list. - Search:
search_catalog,get_product. - Assemble the cart:
add_to_cart/update_cart,get_cart. - Lock: the merchant calls
/v1/negotiateand returnssessionId+invoiceHash. The agent recomputes the hash. - Human consent: show the human the cart and total; obtain the consent token.
- Pay: transact-tier tool, or
/v1/transactdirectly. - Confirm the order after the merchant independently reconciles the payment with the processor.