Leat MCP by usefulapi

v1.2.1
io.usefulapi/piggy Checked 3 days ago Published 1 day ago

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

ParameterTypeDescription
created_fromstringOnly contacts created on or after this date (created_at[gte]).
created_tostringOnly contacts created on or before this date (created_at[lte]).
limitintegerRecords per page (default 10, max 100).
pageintegerPage number (default 1).
sortstringSort 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=.

ParameterTypeDescription
email *stringThe contact's email address.

piggy_get_contact Get contact

Get one loyalty contact by UUID, with attributes, tier and subscriptions. GET /contacts/{uuid}.

ParameterTypeDescription
contact_uuid *stringUUID.

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.

ParameterTypeDescription
contact_uuid *stringUUID.

piggy_get_credit_balance Get credit balance

Get a contact's current loyalty credit balance (points). GET /contacts/{uuid}/credit-balance.

ParameterTypeDescription
contact_uuid *stringUUID.

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.

ParameterTypeDescription
contact_uuid *stringUUID.

piggy_get_contact_tier Get contact tier

Get the loyalty tier a contact currently holds. GET /contacts/{uuid}/tier.

ParameterTypeDescription
contact_uuid *stringUUID.

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.

ParameterTypeDescription
created_fromstringOnly transactions created on or after this date (created_at[gte]).
created_tostringOnly transactions created on or before this date (created_at[lte]).
limitintegerRecords per page (default 10, max 100).
pageintegerPage number (default 1).
shop_uuidstringOnly transactions at this business profile (shop) UUID.
sortstringSort column; prefix with '-' for descending (e.g. -created_at).
typestringOnly 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.

ParameterTypeDescription
business_profile_uuidstringOnly orders at this business profile UUID.
contact_uuidstringOnly orders of this contact UUID.
created_fromstringOnly orders created on or after this date (created_at[gte]).
created_tostringOnly orders created on or before this date (created_at[lte]).
limitintegerOrders per page (default 30, max 30).
pageintegerPage 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.

ParameterTypeDescription
external_identifier *stringThe 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}.

ParameterTypeDescription
uuid *stringUUID.

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

ParameterTypeDescription
uuid *stringUUID.

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.

ParameterTypeDescription
email *stringThe new contact's email address.
referral_codestringOptional 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.

ParameterTypeDescription
business_profile_uuid *stringThe business profile where the points are given.
confirm *booleanMust be true. Confirms that the user asked for this change: it changes a customer's points.
contact_uuid *stringThe contact's UUID.
points *integerPoints to add; negative subtracts.
custom_attributesobjectOptional 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.

ParameterTypeDescription
confirm *booleanMust be true. Confirms that the user asked for this change: it changes a customer's points.
uuid *stringThe direct points transaction UUID to reverse.