Tools are registered for session, discovery, configuration, and checkout. Names below match what your MCP client lists.
start_chat_session
Open a session token for a visitor’s gift chat.
When to use: Call once when the visitor opens gift-card chat. Keep the same sessionToken for the whole conversation. Company details are already on your account; you only need a stable visitorRef.
- Parameters
visitorRef: Stable id from your app (signed-in user id or anonymous session id). Stored on the chat session.
chatterName: Optional. Chat bot, assistant, or persona name hosting gift-card chat.
Returns: sessionId and sessionToken. Pass sessionToken on every subsequent present_* tool call. One in-progress gift at a time.
refresh_chat_session
Mint a new sessionToken when the previous one expires.
When to use: When present_* calls return 401 for an expired sessionToken but the chat session is still valid.
- Parameters
sessionId: sess_… id from start_chat_session (required).
Returns: Fresh sessionToken for present_* tools.
start_present
Begin the single in-progress gift for this session.
When to use: When the user wants to buy a gift. Requires sessionToken from start_chat_session. Collect buyer email first. If a gift is already in progress, call cancel_present first.
- Parameters
sessionToken: From start_chat_session (required).
buyerEmail: Email of the person paying for the gift (required).
Returns: presentId for the gift. The same sessionToken remains valid for present_* tools.
cancel_present
Abandon the in-progress gift; keep the same sessionToken.
When to use: When the visitor abandons the current gift or wants a different one. Then call start_present again with the same sessionToken. Cannot cancel after payment succeeds.
- Parameters
sessionToken: Required.
presentId: Optional. The session has at most one present after start_present.
Returns: Confirmation the present was detached from the session. Keep sessionToken and call start_present for the next gift.
get_categories
List gift-card categories and occasions.
When to use: Early in the conversation, ask what the recipient enjoys, then suggest matching categories (food & drink, sports, beauty, birthday, Christmas, etc.).
No parameters.
Returns: categories[] and occasions[] with ids and display names for browsing.
get_retailers_for_categories
List brands available for chosen category ids.
When to use: After get_categories, when the user has picked interests (e.g. food-and-drink, sports). Surfaces retailer names and PapBrand slugs.
- Parameters
categoryIds: One or more category ids from get_categories (e.g. ["food-and-drink", "sports"]).
Returns: retailers[] with brand metadata for suggestions in chat.
search_gift_cards
Free-text search across themes and brands.
When to use: When the user describes tastes in natural language (“coffee lover”, “gamer”, “spa day”). Refine the query if results are broad.
- Parameters
query: Search string (required), e.g. coffee, outdoor, gaming.
limit: Max results per type (1–20, default 10).
Returns: themes[] and brands[] with slugs/ids. Theme guides live at /inspiration/{slug}; brand guides at /gift/{brandId}.
present_get_state
Read the in-progress gift: delivery, value, content, and workflow stage.
When to use: After start_present, whenever you need to see what is already set and what still needs collecting.
- Parameters
sessionToken: Required on every present_* tool.
presentId: Optional. The session has exactly one present after start_present.
Returns: state object including stage (e.g. ready_for_payment), delivery fields, amount/currency, message, surfaceBrand.
present_update_delivery
Set how and when the gift reaches the recipient.
When to use: When delivery details are missing or the user changes their mind.
- Parameters
sessionToken: Required. presentId optional.
deliveryMethod: email | sms | none
recipientEmail: Recipient email when using email delivery.
recipientPhone: E.164 phone for sms.
sendTo: self | recipient | third-party | none
sendAt: Optional ISO 8601 datetime to schedule sending.
Returns: Updated state for the present.
present_update_value
Set gift card amount and currency.
When to use: When the buyer chooses how much to put on the card.
- Parameters
sessionToken: Required. presentId optional.
amount: Positive number (required).
currency: e.g. GBP (optional; defaults apply server-side).
Returns: Updated state with value filled in.
present_update_content
Set the personal message and which brand’s gift card to issue.
When to use: When the buyer has chosen a retailer (surfaceBrand slug from search or retailers list) and written a message.
- Parameters
sessionToken: Required. presentId optional.
message: Gift message shown to the recipient.
surfaceBrand: PapBrand slug from the catalogue (e.g. amazon), or null to clear.
Returns: Updated state; the chosen brand is purchased when the buyer completes payment.
present_setup_payment
Prepare checkout for the completed gift (mode-dependent).
When to use: When present_get_state shows ready_for_payment (delivery, value, and content are all set).
- Parameters
sessionToken: Required. presentId optional.
settlementMode: Optional override: link_out | line_item | agentic_checkout (must be allowed on the affiliate account).
Returns: link_out → paymentLink; line_item → line_item + settlement_url; agentic_checkout → checkout_session for present_complete_checkout.
present_settle_line_item
Confirm host-collected payment for a line_item gift.
When to use: After your shop charged the buyer for the exported line_item. Uses your MCP organisation credentials (same as this connection), with no separate webhook secret.
- Parameters
presentId: From present_setup_payment / start_present.
amount: Gift face value in major units (must match the present).
currency: e.g. GBP.
orderReference: Optional host order id.
pspReference: Optional PSP payment id.
Returns: Confirmation that payment was accepted and gift-card issuance was queued.
present_complete_checkout
Complete agentic_checkout with a payment token.
When to use: After present_setup_payment returned a checkout_session and the host minted a Stripe Shared Payment Token (or mock_pay_* in development).
- Parameters
sessionToken: Required.
checkoutSessionId: cs_… from present_setup_payment.
paymentToken: Delegated payment token from the host wallet / PSP.
paymentProvider: stripe | mock | shared_payment_token.
Returns: Updated checkout_session; gift-card issuance queued after a succeeded charge.