MCP
Discounts tools
MCP tools for discounts: what each does, the key level it needs, the operation it runs and its input schema. Part of the MISSIN public API: call it with an…
An operation tool runs one API operation and takes its variables, so the operation's page says what each accepts. Two differences: the server fills in workspaceId and updatedBy, and campaignId, partnerId, formId, discountCodeId, socialNetworkId, waitlistId, incentiveId, channelId also take the record's name. A task tool chains several operations and is described here in full. Every tool's input schema, keyed by tool name: discounts.schema.json.
Task tools
save_discount_code
Access: Write · Kind: task · Toolset: core · Hints: idempotent
Create a discount code, or update the one with this code or id. Updating takes only the fields to change; creating needs the whole body (code, title, aliased_codes, value_kind percent|amount with value_percent/value_amount, usage_limit, start_at, ends_at, status — null where there is none), and a missing field comes back as an error before anything is written. Makes one write, so it is all-or-nothing. Returns { id, created }.
Try: “Make a 15% code SPRING15 that ends on 31 May.”
Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"description": "Update this discount code. Omit to update the code with exactly body.code, or create it.",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"connectionId": {
"description": "Place the code on this store connection (list_workspace_connections).",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"body": {
"type": "object",
"properties": {
"code": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"pattern": "^\\S+$"
},
"aliased_codes": {
"maxItems": 1000,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"code": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"pattern": "^\\S+$"
}
},
"required": [
"code"
]
}
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"display_name": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
]
},
"value_kind": {
"type": "string",
"enum": [
"percent",
"amount"
]
},
"value_percent": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 100
},
{
"type": "null"
}
]
},
"value_amount": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 5000
},
{
"type": "null"
}
]
},
"usage_limit": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 999999
},
{
"type": "null"
}
]
},
"start_at": {
"type": [
"string",
"null"
]
},
"ends_at": {
"type": [
"string",
"null"
]
},
"one_time_purchase": {
"default": false,
"type": "boolean"
},
"status": {
"type": "string",
"enum": [
"EXPIRED",
"DRAFT",
"SCHEDULED",
"ACTIVE"
]
},
"is_public": {
"type": "boolean"
},
"public_tier": {
"type": "string",
"enum": [
"BASIC",
"QUICK",
"ENHANCED"
]
},
"origin": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"tags": {
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 180
},
"additionalProperties": {
"type": "string",
"enum": [
"default",
"gray",
"brown",
"orange",
"yellow",
"green",
"blue",
"purple",
"pink",
"red"
]
}
},
"placements": {
"type": "array",
"items": {
"type": "object",
"properties": {
"connectionId": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"child": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": [
"connectionId"
]
}
}
},
"description": "Discount columns: code, title, value_kind with value_percent or value_amount, status, start_at, ends_at, usage_limit, combine flags."
}
},
"required": [
"body"
]
}Operation tools
| Tool | Operation | Access | Toolset | Hints | What it does |
|---|---|---|---|---|---|
add_discount_placements | AddDiscountPlacements | Write | discounts | Place discount codes on a store or email connection; the codes are pushed to the provider. | |
bulk_remove_tag_from_workspace_discounts | BulkRemoveTagFromWorkspaceDiscounts | Write | discounts | destructive | Remove a tag from every discount code in the workspace. Irreversible. |
bulk_rename_tag_across_workspace_discounts | BulkRenameTagAcrossWorkspaceDiscounts | Write | discounts | Rename a tag on every discount code in the workspace. | |
bulk_sync_discount_codes | BulkSyncDiscountCodes | Write | discounts | Re-push the selected discount codes to their providers. | |
bulk_update_discount_code_status | BulkUpdateDiscountCodeStatus | Write | discounts | Set the status of many discount codes at once; each code is clamped to what it allows. | |
create_discount_code | CreateDiscountCode | Write | discounts | Create a discount code and, with connectionId, place it on that store. | |
delete_discount_code | DeleteDiscountCode | Write | discounts | destructive | Delete a discount code here and at its providers. Irreversible. |
get_discount_campaigns | DiscountCampaigns | Read | discounts | read-only, idempotent | List the campaigns a discount code is linked to. |
get_discount_changes | DiscountChanges | Read | discounts | read-only, idempotent | Page through a discount code's change history and provider sync state. |
get_discount_code_alias_exists | DiscountCodeAliasExists | Read | discounts | read-only, idempotent | Check whether codes are already used as a code or alias in this workspace. |
get_discount_code_form_responses | DiscountCodeFormResponses | Read | discounts | read-only, idempotent | Form responses that used one discount code. |
get_discount_code_orders | DiscountCodeOrders | Read | discounts | read-only, idempotent | Page through orders that used one discount code, with revenue totals. |
get_discount_code_order_series | DiscountCodeOrderSeries | Read | discounts | read-only, idempotent | Daily order count and revenue series for one discount code. |
get_discount_code_partners | DiscountCodePartners | Read | discounts | read-only, idempotent | The partner one discount code belongs to. |
get_discount_code_response_series | DiscountCodeResponseSeries | Read | discounts | read-only, idempotent | Daily form-response series for one discount code, total and attributed. |
get_discount_codes_aggregates_filtered | DiscountCodesAggregatesFiltered | Read | discounts | read-only, idempotent | Totals across the discount codes matching a filter: count, usage and value. |
list_discount_codes | DiscountCodesList | Read | core | read-only, idempotent | List discount codes with filter, sort and offset paging: code, value, status, usage and tags. Totals and detail are off unless requested: set withTotal to true to include them. |
get_discount_code_tag_facets | DiscountCodeTagFacets | Read | discounts | read-only, idempotent | List discount tags with their colour and usage count. |
get_discount | DiscountDetail | Read | core | read-only, idempotent | Get one discount code by id with orders, revenue, partner, placements and incentive rules. |
get_discount_placements_by_code | DiscountPlacementsByCode | Read | discounts | read-only, idempotent | List where one discount code is placed (store, email platform) and each placement's sync state. |
get_discount_placement_targets | DiscountPlacementTargets | Read | discounts | read-only, idempotent | List the products and collections a discount code's placements target. |
remove_discount_placement | RemoveDiscountPlacement | Write | discounts | destructive | Remove a discount placement and delete it at the provider. Irreversible. |
resync_discount_placement | ResyncDiscountPlacement | Write | discounts | Re-queue a discount placement's push to its provider. | |
search_placement_targets | SearchPlacementTargets | Read | discounts | read-only, idempotent | Search a store connection's products or collections to target with a discount. |
set_discount_tag_color | SetDiscountTagColor | Write | discounts | idempotent | Set a discount tag's colour. |
set_placement_targets | SetPlacementTargets | Write | discounts | idempotent | Replace the products and collections a discount placement targets. |
sync_all_discount_codes | SyncAllDiscountCodes | Write | discounts | Re-push every discount code to its providers. | |
update_discount_code | UpdateDiscountCode | Write | discounts | Update a discount code and push the change to its placements. | |
update_discount_placement_child | UpdateDiscountPlacementChild | Write | discounts | Edit the provider-specific fields of one discount placement. | |
withdraw_discount_placement | WithdrawDiscountPlacement | Write | discounts | Withdraw a discount placement without deleting the code. |