Skip to main content
The Subtotal Data MCP provides four tools — for exploring and querying your purchase data, and for configuring the retailers available for linking.

ask

Ask a natural language question about your purchase data. The server translates it into SQL and returns the results — no SQL knowledge required. Parameters: Example questions:
  • “Show me the top 5 retailers by purchase count this year”
  • “How many active connections do I have?”
  • “What are my highest-value purchases from the last 30 days?”
  • “Which brands appear most frequently in my items?”
Response format:
Constraints:
  • Questions must be plain English — embedded SQL will be rejected
  • Only SELECT queries are generated — your data is never modified
  • Results are limited to 100 rows and 5 MB
  • A 5-second execution timeout is enforced
If the question cannot be answered with the available data, or the generated query fails, the response will contain an error field:
Other possible errors include request timeouts and response size limits.
ask uses an AI model to translate your question into SQL. For best results, be specific about the data you want, time ranges, and how results should be grouped or sorted. To inspect the data model itself (entities, fields, relationships), use get_data_model instead.

get_retailers

List the retailers available to your account as structured rows. By default returns only the retailers enabled for your team (each with a Subtotal Link URL); pass include="all" to list every active retailer in the catalog, annotated with whether it’s enabled for your team. Requires the retailers:read OAuth scope. Connectors set up before this scope existed need to disconnect and reconnect to grant it; until then the tool returns error_category: "insufficient_scope". Parameters: Response format:
Fields:
This is the same retailer contract returned by the public GET /retailers API. With include="all", link_url is null for retailers not enabled for your team.

update_retailer

Update a retailer for your account: enable or disable it, and set who sees it on the Subtotal Link retailer-selection page. Every argument except retailer_id is optional, and omitted ones are left unchanged, but a call must set at least one of enabled, link_visibility or link_audience. Requires the retailers:write OAuth scope; a connector without it gets error_category: "insufficient_scope".
  • Visibility needs the retailer enabled: either already, or with enabled: true in the same call.
  • link_audience replaces the stored lists. Send both lists to keep entries you want.
  • restricted needs an audience: at least one email or domain, counting lists already stored.
  • Disabling takes no visibility settings: enabled: false can’t be combined with link_visibility or link_audience.
Disabling is destructive: it removes your configuration for the retailer. Links you’ve already shared stop working, and re-enabling issues a new link_url with link_visibility reset to everyone.
Parameters: Example — enable and restrict to one domain in a single call:
Response format:
With enabled: false, link_url, link_visibility and link_audience come back null.
Returns the same row shape as get_retailers and the public PATCH /retailers/{retailer_id} API. Repeating a call returns the current row. These return an error field with error_category: "invalid_input": an unknown retailer_id, no fields to update, visibility settings for a retailer that isn’t enabled, visibility settings with enabled: false, or restricted with no audience. Invalid emails or domains, more than 100 entries in a list, or a link_visibility other than the three values are also rejected.

get_data_model

Returns the data model for your purchase data, including entities, fields, types, and relationships. Parameters: None Returns: A plain-text data model describing six entities: connection, purchase, item, retailer, product, and brand.
If you’re using ask, you typically don’t need to call get_data_model — the server already has the data model when answering questions.