Theme tools for AI assistants
The theme tools of Tanqory's MCP server, what each one does, and the scopes it needs.
Tanqory's MCP server gives an AI assistant the tools to design a store's theme and fill the store, with every change checked against the theme standard and saved as a draft first. Connect the assistant as in AI connectors; the tools it sees depend on the scopes the merchant approves.
The tools
| Tool | Does | Needs |
|---|---|---|
theme_guide | The guide for building a theme, for assistants that do not load skills | every connection |
theme_reference | A reference: every section and block of the base theme with its settings, the settings, the templates, the limits | every connection |
theme_init | The base theme's starter files | every connection |
theme_validate | Checks files; each problem comes back with file, line, column and how to fix it | every connection |
theme_scaffold | Advanced mode: a plain starter for a completely new theme with its own layout and styles; changes nothing in the store | every connection |
theme_get, theme_files | Lists the store's themes and reads a theme's files | read_themes |
theme_preview_url | A private preview link of the draft that stays the same after each push | read_themes |
theme_preview_screenshot | Desktop and mobile images of a page of the draft | read_themes |
theme_upload_target | A one-hour link to upload a video or a large image yourself (PUT); changes nothing in the store | write_themes |
theme_upload_asset | Turns an image or video (an https URL, a small inline file, or a file uploaded to a theme_upload_target link) into a store file and returns its https address | write_themes |
theme_push_draft | Saves files into a draft theme; never touches the live theme | write_themes |
theme_publish | Makes the draft live | write_themes |
theme_code_files | Advanced mode: reads the code of one of the store's custom themes, whichever AI tool built it | read_themes |
theme_code_push | Advanced mode: adds files to the staging area of a custom theme's next build, in as many calls as the theme needs; changes nothing in the store | write_themes |
theme_code_commit | Advanced mode: builds the staged theme in Tanqory's sandbox and checks it; the merchant approves each build | write_themes |
theme_build_status | Advanced mode: whether a custom theme build is still running, what to fix, or that it is ready to preview, and which files are staged for the next build | read_themes |
Changes ask twice
theme_upload_asset, theme_push_draft, theme_publish and theme_code_commit change the store, so each takes two calls. The first answers with what will change and a confirmationToken. The assistant shows that to the merchant and, only when the merchant agrees, calls the same tool again with the token alone, { "confirmationToken": "…" }. Sending the same arguments again with the token also works; different arguments are refused. A token lasts 5 minutes and works once.
theme_code_push does not ask: it only stages files for the next build, and nothing in the store changes until the merchant approves theme_code_commit.
Build a custom theme in parts
A custom theme (Advanced mode) is often a few hundred kilobytes of code, more than an assistant should write in one tool call. It goes in parts:
- Stage the files. Call
theme_code_pushwith the theme'shandleand some of its files, about 32 KB of text per call, as many times as needed. Each call adds to what is already staged for that handle; a path sent again replaces its staged copy. A file left out of a call stays staged: nothing is ever deleted because a call did not include it. Each file is checked on its own as it arrives (paths, JSON syntax, imports, no network calls, no inline styles or scripts), and a call with a problem stages none of its files and answers every finding with file and line. - Check what is staged.
theme_build_statuswith thehandleand nobuildIdlists every staged path with its size and SHA-256, so the assistant can compare it with its own copy before building. - Commit. Call
theme_code_commitwith thehandle(and anamefor the Themes page). It checks the whole theme against the standard: the staged files laid over the theme's latest build, so a change needs only the files that changed. The merchant sees the card (files added, changed and removed, and the files kept from the latest build) and approves it. - Approve with the token. Call
theme_code_commitagain with only theconfirmationToken. The token is bound to the exact staged content: if a file was staged in between, the approval is refused withstaged_content_changedand nothing is built, so calltheme_code_commitwithout the token to show the merchant the new card. - Follow the build. The answer is the build's state;
theme_build_statuswith thebuildIdandwait: truefollows it until it isready, with the draft'sthemeIdand a preview link, orfailed, with each error at its file and line. To fix one, stage only the files you change and commit again.
Removing a file is always explicit: name it in theme_code_commit's delete list, or commit with replaceAll: true to build only the staged files as the whole theme. Staged files wait 24 hours after the last push to the handle; a store may stage up to 5 themes at once, at most 200 files and 2 MiB per theme, 256 KiB per file. A commit that starts a build empties the staging area of the files it built.
From a terminal, the tanqory-theme CLI of @tanqory/theme-mcp does the same in one command: tanqory-theme code push <folder> --handle <handle> stages the folder in parts, shows the card, approves it once and follows the build to the preview link.
What a check looks like
theme_validate on the starter files passes:
Valid: 4 files meet the Tanqory theme standard (2 warnings).A file that names a section the base theme does not have fails, and nothing is saved:
Not valid: 1 error in 1 file. Fix each one at the file and line given, then validate again. Nothing was saved.
templates/index.json:1:48 error unknown_component Unknown component "no-such-section". ...Try it
With the assistant connected and the theme scopes approved, ask for example: "Make my store's home page feel calm and minimal, with a large hero image and three featured collections. Show me the preview before you publish anything."
Partner tools
Theme partners have a second MCP server, https://mcp.tanqory.com/partners. Connect it the same way; the sign-in shows your partner organizations instead of a store, and the assistant gets what your role in each organization allows, nothing in a store you sell from.
| Tool | Does |
|---|---|
partner_organizations | Your partner organizations and what your role may do |
partner_theme_list, partner_theme_versions | An organization's themes and their versions |
partner_theme_version_checks | A version's 15 check lines; each failed one comes with what to fix |
partner_development_stores | The development stores a version can be installed on |
partner_theme_install | Builds a version in the sandbox, runs every check and installs it on a development store as a draft |
partner_theme_submit | Sends a version whose 15 checks passed to Tanqory review |
partner_theme_withdraw | Takes a submission back from review |
partner_theme_install, partner_theme_submit and partner_theme_withdraw ask twice, as the store tools do: the first call answers what will change and a confirmationToken. Uploading a version is not one of these tools: the source is on your machine (Upload a theme source).