Skip to main content

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

ToolRequired parametersPurpose
search_catalognone (query, vertical, maxPrice optional)Search by keyword, vertical (groceries, tech, hotel), and maximum price in dollars.
get_productidFull specs, stock, variants and pricing for a product ID or handle.
add_to_cartproductId, quantityAdd an item. cartId optional (a new cart is created if omitted); variantId optional; hotel stays take checkIn / checkOut (YYYY-MM-DD).
get_cartcartIdCart contents, breakdown and subtotal/tax.
confirm_ordercartId, transactionIdConfirm fulfillment only after the merchant matches the order with the processor confirmation it requires.
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:

TierToolsGate
Answersearch_catalog, get_product, search_shop_policies_and_faqsNone
Actget_cart, update_cart, cancel_cart, browse_store, show_variant, manage_ordersNone
Transactcreate_checkout, transact, execute_paymentRequires 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.codeHTTPMeaning
USER_CONFIRMATION_REQUIRED403Missing, invalid, expired, mismatched or already-used consent token.
INVALID_ARGUMENTS400arguments is missing or not a JSON object.
UNKNOWN_TOOL400The tool is not registered.

A transact-tier tool needs proof that a human approved this purchase.

  • Tokens look like ctok.<payload>.<signature> and are bound to one sessionId.
  • A token is valid for 5 minutes and works once.
  • The sessionId in arguments must 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-use ctok.… 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).
  1. Discover: read the manifest, call tools/list.
  2. Search: search_catalog, get_product.
  3. Assemble the cart: add_to_cart / update_cart, get_cart.
  4. Lock: the merchant calls /v1/negotiate and returns sessionId + invoiceHash. The agent recomputes the hash.
  5. Human consent: show the human the cart and total; obtain the consent token.
  6. Pay: transact-tier tool, or /v1/transact directly.
  7. Confirm the order after the merchant independently reconciles the payment with the processor.