Tool reference

### Tool reference

The eight tools the AIOD MCP server exposes, what each one is for, and the conventions they share.

The AIOD MCP server exposes eight tools. Five read, three write. There is no general Shopify API access behind them.

Most people never need this page — your assistant picks the right tool on its own. It is here for anyone building an agent, debugging a call, or wanting to know exactly what a tool returns.

### Navigate to header: The tools The tools

### Navigate to header: At a glance At a glance

| Tool | Touches your store | Writes to Shopify |
| --- | --- | --- |
| shopify\_discount\_config\_schema | No | No |
| shopify\_discount\_docs\_search | No | No |
| shopify\_discount\_find | Reads | No |
| shopify\_discount\_get | Reads | No |
| shopify\_discount\_performance | Reads | No |
| shopify\_discount\_draft | Reads | No — stages a draft only |
| shopify\_discount\_publish | Reads | Yes — creates a new discount, in test mode |
| shopify\_discount\_update | Reads | Yes — overwrites an existing discount, in test mode |

Every read tool is marked read-only, so most clients allow them without asking.

shopify\_discount\_draft

and

shopify\_discount\_publish

are not marked destructive: one changes nothing in Shopify, the other only adds a new discount in test mode.

shopify\_discount\_update

is marked

destructive

, which means well-behaved clients will ask you before every single call.

Why is updating “destructive”? It replaces an existing discount’s rule and forces it back into test mode — so a discount that was live for shoppers stops applying. That deserves a prompt. Creating a

new

discount touches nothing already in the store, so it has its own tool without one.

### Navigate to header: Things that apply to every tool Things that apply to every tool

### Navigate to header: Discount ids Discount ids

Every store-scoped tool needs an AIOD discount id, and the only place to get one is

Find discounts

. It is not a Shopify discount GID. Never build one by hand.

### Navigate to header: Configurations are sparse Configurations are sparse

All three write tools take a

config

object containing

only the fields you are setting

.

Creating — the config must name a template .

Editing — send only what changes. It is merged onto the stored configuration, not swapped in for it. So read the discount first: you cannot safely change a field without knowing its current value.

These shapes belong to AIOD. They are

not

Shopify’s native discount API shapes and cannot be guessed from them. Anything invented gets rejected rather than quietly fixed.

### Navigate to header: Rejections are useful, not fatal Rejections are useful, not fatal

When a tool returns a

4xx

, that is not a broken connection. It is a result to read.

A rejected draft or publish comes back with an

issues

list naming the exact fields at fault, and it carries the relevant reference material inline — so you can fix those fields and call again without starting over or re-fetching the schema.

| Code | What it means | What to do |
| --- | --- | --- |
| unsupported\_template | The template is missing or not a real one. | Pick one from the list attached to the rejection. |
| edit\_changed\_nothing | Your patch matched the saved discount exactly. | The change you meant to make wasn’t in it. Look at the current config again. |
| template\_field\_out\_of\_scope | Every field you sent is uneditable for this template. | Stop. Tell the merchant the setting isn’t available here. Don’t retry. |
| tier\_has\_no\_action | A tier ended up empty. | Each tier needs conditions and actions in the shapes from the reference. |
| config\_shape\_parse\_failed | A condition or action field has the wrong shape. | Fix that one field. The exact syntax comes back with the error. |
| saved\_rule\_unavailable | The discount you’re editing couldn’t be read safely. | Nothing was staged. Don’t retry blindly. |
| publish\_target\_not\_allowed | shopify\_discount\_publish was sent a targetDiscountId . It only creates. | To overwrite that discount, use shopify\_discount\_update . Nothing was changed. |
| update\_target\_required | shopify\_discount\_update was called without targetDiscountId . | To create a new discount, use shopify\_discount\_publish . Nothing was changed. |
| target\_not\_found | The targetDiscountId sent to shopify\_discount\_update isn’t one of this store’s discounts. | Get the id from shopify\_discount\_find . Nothing was changed. |

And the HTTP statuses:

| Status | Meaning |
| --- | --- |
| 400 | Missing or unusable input. |
| 404 | That id isn’t one of this store’s discounts. |
| 422 | The discount being edited couldn’t be loaded. |
| 200 with ok: false | Validation or simulation rejected it. Read issues . |

If AIOD’s session for the store breaks — usually after an uninstall — every tool returns an error asking you to reconnect, rather than failing opaquely.

### Navigate to header: Timeouts Timeouts

One tool call, 60 seconds.

### Navigate to header: Old tool names Old tool names

The tools were renamed when they were namespaced. Clients are only ever offered the current names, but the old ones still work if you have them written down.

| Old | Current |
| --- | --- |
| get\_aiod\_context | shopify\_discount\_config\_schema |
| search\_aiod\_docs | shopify\_discount\_docs\_search |
| find\_discounts | shopify\_discount\_find |
| get\_discount | shopify\_discount\_get |
| get\_discount\_performance | shopify\_discount\_performance |
| save\_discount\_draft | shopify\_discount\_draft |
| publish\_discount | shopify\_discount\_publish |

publish\_discount

keeps its old combined behaviour: it creates a discount, or overwrites one when

targetDiscountId

is passed.

shopify\_discount\_update

has no old name.

[Find discounts](https://www.aiodapp.com/docs/mcp-server/tools/shopify-discount-find)

[Navigate to header: The tools](https://www.aiodapp.com/docs/mcp-server/tools#the-tools)

[Navigate to header: At a glance](https://www.aiodapp.com/docs/mcp-server/tools#at-a-glance)

[Navigate to header: Things that apply to every tool](https://www.aiodapp.com/docs/mcp-server/tools#things-that-apply-to-every-tool)

[Navigate to header: Discount ids](https://www.aiodapp.com/docs/mcp-server/tools#discount-ids)

[Navigate to header: Configurations are sparse](https://www.aiodapp.com/docs/mcp-server/tools#configurations-are-sparse)

[Navigate to header: Rejections are useful, not fatal](https://www.aiodapp.com/docs/mcp-server/tools#rejections-are-useful-not-fatal)

[Navigate to header: Timeouts](https://www.aiodapp.com/docs/mcp-server/tools#timeouts)

[Navigate to header: Old tool names](https://www.aiodapp.com/docs/mcp-server/tools#old-tool-names)