Leat MCP by usefulapi
v1.2.1Read contacts, points, orders and rewards; add or reverse points in Leat.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
piggy_list_contacts List contacts
List the loyalty contacts (end-users) of the account, newest first by default. Use created_from / created_to to filter by creation date. GET /contacts.
| Parameter | Type | Description |
|---|---|---|
created_from | string | Only contacts created on or after this date (created_at[gte]). |
created_to | string | Only contacts created on or before this date (created_at[lte]). |
limit | integer | Records per page (default 10, max 100). |
page | integer | Page number (default 1). |
sort | string | Sort column; prefix with '-' for descending (e.g. -created_at). |
piggy_find_contact Find contact by email
Find one loyalty contact by email address. GET /contacts/find-one-by?email=.
| Parameter | Type | Description |
|---|---|---|
email * | string | The contact's email address. |
piggy_get_contact Get contact
Get one loyalty contact by UUID, with attributes, tier and subscriptions. GET /contacts/{uuid}.
| Parameter | Type | Description |
|---|---|---|
contact_uuid * | string | UUID. |
piggy_get_contact_identifiers Get contact identifiers
List the identifiers (for example card or app ids) linked to a contact. GET /contacts/{uuid}/contact-identifiers.
| Parameter | Type | Description |
|---|---|---|
contact_uuid * | string | UUID. |
piggy_get_credit_balance Get credit balance
Get a contact's current loyalty credit balance (points). GET /contacts/{uuid}/credit-balance.
| Parameter | Type | Description |
|---|---|---|
contact_uuid * | string | UUID. |
piggy_get_prepaid_balance Get prepaid balance
Get a contact's prepaid balance (money held for the contact, in the lowest currency unit). GET /contacts/{uuid}/prepaid-balance.
| Parameter | Type | Description |
|---|---|---|
contact_uuid * | string | UUID. |
piggy_get_contact_tier Get contact tier
Get the loyalty tier a contact currently holds. GET /contacts/{uuid}/tier.
| Parameter | Type | Description |
|---|---|---|
contact_uuid * | string | UUID. |
piggy_list_loyalty_transactions List loyalty transactions
List credit receptions (points earned) and reward receptions (rewards redeemed), newest first by default. Filter by type, business profile and date. GET /loyalty-transactions.
| Parameter | Type | Description |
|---|---|---|
created_from | string | Only transactions created on or after this date (created_at[gte]). |
created_to | string | Only transactions created on or before this date (created_at[lte]). |
limit | integer | Records per page (default 10, max 100). |
page | integer | Page number (default 1). |
shop_uuid | string | Only transactions at this business profile (shop) UUID. |
sort | string | Sort column; prefix with '-' for descending (e.g. -created_at). |
type | string | Only this transaction type. |
piggy_list_orders List orders
List the orders replicated into Leat, optionally for one contact or business profile, by creation date. GET /orders.
| Parameter | Type | Description |
|---|---|---|
business_profile_uuid | string | Only orders at this business profile UUID. |
contact_uuid | string | Only orders of this contact UUID. |
created_from | string | Only orders created on or after this date (created_at[gte]). |
created_to | string | Only orders created on or before this date (created_at[lte]). |
limit | integer | Orders per page (default 30, max 30). |
page | integer | Page number (default 1). |
piggy_find_order Find order by external id
Find one order by the unique identifier from the source system (external_identifier). GET /orders/find.
| Parameter | Type | Description |
|---|---|---|
external_identifier * | string | The order's identifier in your own system. |
piggy_get_order Get order
Get one order by its Leat UUID, with line items and processing results. GET /orders/{uuid}.
| Parameter | Type | Description |
|---|---|---|
uuid * | string | UUID. |
piggy_get_direct_points_transaction Get direct points transaction
Get one direct points transaction (a manual points grant or deduction) by UUID. GET /direct-points-transactions/{uuid}.
| Parameter | Type | Description |
|---|---|---|
uuid * | string | UUID. |
piggy_create_contact Create contact
WRITE: create a loyalty contact with an email address. Fails with code 60005 if the email already exists: use piggy_find_contact first. POST /contacts.
| Parameter | Type | Description |
|---|---|---|
email * | string | The new contact's email address. |
referral_code | string | Optional referral code for the referral programme. |
piggy_add_direct_points Add or subtract points
WRITE: add a whole number of points to a contact's balance at a business profile (negative subtracts). Changes real balances: set confirm to true only after the user approves the amount. POST /direct-points-transactions. Not retried automatically.
| Parameter | Type | Description |
|---|---|---|
business_profile_uuid * | string | The business profile where the points are given. |
confirm * | boolean | Must be true. Confirms that the user asked for this change: it changes a customer's points. |
contact_uuid * | string | The contact's UUID. |
points * | integer | Points to add; negative subtracts. |
custom_attributes | object | Optional custom attribute values for the transaction, by attribute name (e.g. reason). |
piggy_reverse_direct_points Reverse points transaction
WRITE: reverse (undo) one direct points transaction by UUID. Changes real balances: set confirm to true only after the user approves. POST /direct-points-transactions/{uuid}/reverse. Not retried automatically.
| Parameter | Type | Description |
|---|---|---|
confirm * | boolean | Must be true. Confirms that the user asked for this change: it changes a customer's points. |
uuid * | string | The direct points transaction UUID to reverse. |