SparkLayer MCP by usefulapi
v1.2.1Read customers, prices, stock and orders, and update customers and stock in SparkLayer.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
sparklayer_list_customer_roles List customer roles
List the customer roles of the site. Good first call before creating or updating customers. SparkLayer API: GET /api/v2/customer-roles.
sparklayer_get_customer Get a customer
Get one customer by SparkLayer id, platform id or email: group, role, price lists, status and default addresses. SparkLayer API: GET /api/v2/customers/{lookupBy}/{identifier}.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | The customer identifier, of the kind set by lookupBy. |
lookupBy * | string | Which identifier you pass: the SparkLayer id, the platform (store) id, or the email address. |
sparklayer_upsert_customer Create or update a customer
WRITE: create a customer, or replace an existing one. The body must hold the identifier from the URL (external_id for platform, email for email, id for a SparkLayer UUID) and the required fields external_id, email, first_name, last_name, status, group and role. Replacing a customer can change its prices and access. SparkLayer API: PUT /api/v2/customers/{lookupBy}/{identifier}.
| Parameter | Type | Description |
|---|---|---|
customer * | object | The customer body, as the SparkLayer CustomerPutRequest schema defines it. |
identifier * | string | The customer identifier, of the kind set by lookupBy. |
lookupBy * | string | Which identifier you pass: the SparkLayer id, the platform (store) id, or the email address. |
sparklayer_list_customer_addresses List a customer's addresses
List the delivery and billing addresses of one customer. SparkLayer API: GET /api/v2/customers/{lookupBy}/{identifier}/addresses.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | The customer identifier, of the kind set by lookupBy. |
lookupBy * | string | Which identifier you pass: the SparkLayer id, the platform (store) id, or the email address. |
sparklayer_list_shopping_lists List shopping lists
List the shopping lists of one customer, optionally for one section. SparkLayer API: GET /api/v2/customers/{lookupBy}/{identifier}/shopping-lists.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | The customer identifier, of the kind set by lookupBy. |
lookupBy * | string | Which identifier you pass: the SparkLayer id, the platform (store) id, or the email address. |
section_id | string | With a section, also returns the customer's own lists that belong to no location. |
sparklayer_list_companies List companies
List the B2B companies of the site, with search and a sales-agent filter. Paged: use page and page_size. SparkLayer API: GET /api/v2/companies.
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (starts at 1). |
page_size | integer | Items per page (up to 250). |
sales_agent_group | string | Only companies of this sales-agent group. |
search_term | string | Free text to search company names. |
sparklayer_get_company Get a company
Get one company by SparkLayer id, platform id or integration id, with its settings. SparkLayer API: GET /api/v2/companies/{lookupBy}/{identifier}.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | The company identifier, of the kind set by lookupBy. |
lookupBy * | string | Which identifier you pass: the SparkLayer id, the platform id, or the integration id. |
include_archived | boolean | true = include archived companies. |
sparklayer_list_company_sections List a company's sections
List the sections (sub-accounts, buying departments) of one company. SparkLayer API: GET /api/v2/companies/{lookupBy}/{identifier}/sections.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | The company identifier, of the kind set by lookupBy. |
lookupBy * | string | Which identifier you pass: the SparkLayer id, the platform id, or the integration id. |
include_archived | boolean | true = include archived sections. |
leafOnly | boolean | true = only the sections that have no child sections. |
sparklayer_list_customer_groups List customer groups
List every customer group of the site, with its parent group. SparkLayer API: GET /api/v1/customer-groups.
sparklayer_list_discounts List discounts
List the discounts of the site that are not deleted: rules, priorities and the customer groups they apply to. SparkLayer API: GET /api/v1/discounts.
sparklayer_get_discount Get a discount
Get one discount by its UUID, with its rules and customer groups. SparkLayer API: GET /api/v1/discounts/{id}.
| Parameter | Type | Description |
|---|---|---|
discount_id * | string | A SparkLayer UUID. |
sparklayer_list_global_settings List global settings
List the global settings of the site as key and value pairs (for example minimum order rules). SparkLayer API: GET /api/v1/settings.
sparklayer_get_cart Get a cart
Get one cart by its UUID: line items, addresses, totals and status. SparkLayer API: GET /api/v1/carts/{id}.
| Parameter | Type | Description |
|---|---|---|
cart_id * | string | A SparkLayer UUID. |
sparklayer_list_shipping_methods List shipping methods
List the shipping methods of the site, with their locations, groups and price bands. SparkLayer API: GET /api/v2/shipping-methods.
sparklayer_list_price_lists List price lists
List the price lists of the site (custom, platform or integration), with currency and adjustment rules. Paged: use page and page_size. SparkLayer API: GET /api/v2/price-lists.
| Parameter | Type | Description |
|---|---|---|
order_by | string | Field to sort by, as the SparkLayer API defines it. |
page | integer | Page number (starts at 1). |
page_size | integer | Items per page (up to 250). |
source | string | Only price lists from this source. |
sparklayer_get_price_list Get a price list
Get one price list by its slug: currency, source and adjustment rules. SparkLayer API: GET /api/v1/price-lists/{slug}.
| Parameter | Type | Description |
|---|---|---|
slug * | string | The price list slug, for example b2b_gb_gbp_123. |
sparklayer_list_price_list_prices List prices in a price list
List the prices stored on one price list (one entry per SKU and quantity break), in pages. Prices that the list's rules derive are not included. Returns total and the rows at offset; use offset to page through a long list. SparkLayer API: GET /api/v1/price-lists/{slug}/pricing.
| Parameter | Type | Description |
|---|---|---|
slug * | string | The price list slug. |
limit | integer | Rows to return (default 200, up to 500). |
offset | integer | Rows to skip (default 0). |
sparklayer_get_sku_prices Get prices for a SKU
Get the prices of one product SKU in every price list that holds it. SparkLayer API: GET /api/v1/pricing/{sku}.
| Parameter | Type | Description |
|---|---|---|
sku * | string | The product SKU (products are matched by SKU). A slash is allowed. |
sparklayer_list_purchases List purchases
List orders, quotes and carts of the site, with filters for status, customer and last-updated dates. Paged by limit and offset: stop when a page has fewer results than limit. SparkLayer API: GET /api/v1/purchases.
| Parameter | Type | Description |
|---|---|---|
customer_sparklayer_id | string | Only purchases of this customer (SparkLayer customer id). |
limit | integer | Results per page (up to 500). |
offset | integer | Results to skip. |
order_by | string | |
order_direction | string | |
search | string | Free text search. |
status | string | Only purchases in this status. |
updated_from | string | Only purchases last updated on or after this date (yyyy-mm-dd or ISO 8601). |
updated_to | string | Only purchases last updated on or before this date (yyyy-mm-dd or ISO 8601). |
sparklayer_get_purchase Get a purchase
Get one purchase (order, quote or cart) by one of its identifiers: lines, addresses, totals and status. SparkLayer API: GET /api/v1/purchases/{lookupBy}/{identifier}.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | The purchase identifier, of the kind set by lookupBy. |
lookupBy * | string | Which purchase identifier you pass. |
sparklayer_get_store_currency Get the store currency
Get the currency code of the store. SparkLayer API: GET /api/v1/store-currency.
sparklayer_get_stock_levels Get stock levels for SKUs
Read the stock levels of up to many SKUs, in all stock locations or in the given ones. Uses POST only to send the SKU list; it changes nothing. SparkLayer API: POST /api/v1/batch-fetch-stock.
| Parameter | Type | Description |
|---|---|---|
skus * | array | The product SKUs to read (up to 200). |
all_stock_locations | boolean | true = all stock locations (default when no location is given). |
stock_location_ids | array | Only these stock locations. |
sparklayer_list_stock_locations List stock locations
List the stock locations (warehouses, shops) of the site. SparkLayer API: GET /api/v1/stock-locations.
sparklayer_update_stock_levels Update stock levels
WRITE: set the stock level of SKUs in stock locations. Each level replaces the current value, so a repeat call with the same values changes nothing more. SparkLayer API: POST /api/v1/batch-update-stock.
| Parameter | Type | Description |
|---|---|---|
updates * | array | The stock levels to set (up to 500 per call). |
sparklayer_get_sync_status Get a sync status
Get the last full and partial sync times, success flag and error count of one integration and data type. SparkLayer API: GET /api/v1/sync-log/{integration}/{data_type}.
| Parameter | Type | Description |
|---|---|---|
data_type * | string | |
integration * | string | The integration name, as the integration registered it. |