Build with an agent
The operating guide for agents building on Shopify with Littleworks.
Assess the fit before connecting
Littleworks provides sandboxed JavaScript, scoped document storage, and a Shopify GraphQL client. A merchant may connect before they know what they want to build. Treat connection and documentation reading as setup, not a request to build anything. Before building or changing anything, confirm the runtime limits fit the requested backend requirements.
Works can call public HTTPS APIs, including an email provider chosen by the merchant, using store secrets. Read Secrets and External requests before adding an integration. Uploads such as artwork or photos go to the merchant’s Shopify Files; see Store files. Littleworks has no theme tools. For the “when this happens” or “every morning” half of a build, use automations: event, schedule and Shopify Flow triggers.
Shopify’s own tools make theme changes: the Shopify connector in Claude, the Shopify plugin in ChatGPT, or, in a coding agent, the Shopify CLI with Shopify’s agent skill from the Shopify AI Toolkit. When what the merchant is building needs theme changes and these are not available, recommend adding them from Shopify’s official install steps rather than installing them, and leave the choice to the merchant; without them, hand over the theme code instead. Littleworks never changes themes itself: theme changes are made with Shopify’s tools under the merchant’s own Shopify sign-in, with the merchant’s go-ahead, in an unpublished theme the merchant publishes.
Connect to the right store
For a concrete build, read the relevant recipe: reviews, wishlists, quote requests, back-in-stock alerts, or transactional email. Adapt it to the merchant’s requested scope. Recipes describe builds to implement, not features already installed in their store. Verify both Shopify and Littleworks connections target the intended store before combining tools.
Filter the Works table by its existing Data group (manifest.feature) to find related works. Group membership cannot be edited here; it determines which works share stored data.
Before handing off a build, delete temporary diagnostics, probes, or one-off setup works you created when they are no longer needed. Call delete_function once per work with its currentVersion from list_functions; it stops the work, so no separate pause is needed. Report how many test records remain (testCount from list_collections) and ask the merchant whether to delete them with delete_test_records. Keep required repair/recovery works and explain their purpose. Preserve unrelated works and data; deletion retains stored documents and historical runs/versions. A new work deployed under a deleted work’s name continues its version numbers.
For theme UI, build reusable, merchant-configurable components: theme blocks where supported, or sections and section blocks that fit the existing theme. Include schema settings and presets so merchants can edit content and presentation in the theme editor. Keep purchase verification and other authorization rules in works, independent of those settings.
Use the merchant’s existing connection or ask them to follow Connect your agent. The shared endpoint is https://littleworks.app/mcp. OAuth selects one store and binds the connection to it. Check the store returned by get_context. Do not request Shopify access tokens or replace other MCP configurations.
The server uses Streamable HTTP MCP and OAuth authorization code flow with S256 PKCE. It advertises authorization metadata and supports dynamic client registration. The merchant approves inside Shopify. One grant covers the whole store.
Inspect before changing anything
- Before building or making changes for a store, call
get_contextfor the store, verified Shopify scopes, programming interface, and limits. For missing Shopify access, explain the minimum scopes needed and send the merchant toshopify.permissions.manageUrl. They approve in Shopify; callget_contextagain afterward. See Shopify permissions. - Call
list_functionsto inspect existing works: their status (draft, published or paused),currentVersion, andnewestVersionwhen a newer version is pending. - Call
get_functionbefore changing an existing work. Preserve its feature and read its source. - Stay within the merchant’s requested scope and approvals. If no further request has been given, report readiness and wait.
Deploy, test, publish
Draft things run the newest version; published things run the current version. A run is real only when it runs the current version of a published work. Every other run is a test run. See Write a work for the details.
- Write self-contained JavaScript and an explicit manifest. See Write a work.
- Deploy with
deploy_function. A new work is a draft and the new version is current. On a published work the new version is pending: the current version keeps serving until it is published. - Test with
invoke_functionand a fresh idempotency key. A draft runs its newest version. For a published work, pass the pending version asversion: invoking it without one is a real run. Test HTTP works at theirpreviewUrland page works on the draft page. - Test runs use the store’s real documents and secrets, and Shopify and external requests have real effects. Test against records your test created: updates and deletes of existing records are real.
- Inspect failures with
get_run. Check for partial effects before retrying a mutation. - Do not delete test records automatically. After testing, tell the merchant how many test records exist (
testCountfromlist_collections) and ask whether to delete them, mentioning when a uniqueness rule means leftover test records could conflict with real saves. If they agree,delete_test_recordsremoves every document a test run created, including setup data, so create real setup data with a real run of a published work, or keep it out of cleanup deliberately and say so.delete_recordremoves one record at its current revision. - Publish only within the merchant’s instructions and approvals:
publish_functionfor a work,publish_viewfor a page and the works it uses. - Verify the required integration, including any frontend work outside Littleworks, before reporting the requested build or change complete.
- Hand off direct links to the view and any preview URL, name the related Data group, and explain where to inspect Runs and Usage. State what is published, which test records remain, and any remaining launch step such as publishing a theme.
Read these docs as Markdown
Every guide has a Markdown link. llms.txt provides the documentation index; llms-full.txt contains all guides in one response. Both are public and contain no store data. The connected store’s get_context is the source for its current capabilities.
See the MCP tool reference for exact tool arguments.