# MCP tool reference

Ten tools to inspect, deploy, run, and manage the backend for a connected store.

Source: https://littleworks.app/docs/mcp

Tools automatically use the authorized store. They do not accept an arbitrary store ID. API names retain `function`; the merchant interface calls these **works**. Use `preview` or `production` for environment arguments.

## Inspect the store and works

| Tool | Arguments | Result |
| --- | --- | --- |
| `get_context` | `{}` | Store, scopes, programming guide, limits, and an illustrative example. Call first. |
| `list_functions` | `{}` | Works with environments, active versions, pause state, and recent protection notices. |
| `get_function` | `{ name, environment }` | Latest 50 saved versions and their source in that environment. |

## Deploy and run

| Tool | Arguments | Effect |
| --- | --- | --- |
| `deploy_function` | `{ manifest, source }` | Validates code, saves an immutable version, and activates it. Returns a URL for HTTP triggers. |
| `invoke_function` | `{ name, environment, input, idempotencyKey }` | Runs a work. Can write data and call Shopify. The key is required and must be 1–128 characters. |
| `set_function_state` | `{ name, environment, paused?, version? }` | Pauses, resumes, or activates a saved version. Supply paused, version, or both. |

For `set_function_state`, `version` is the saved deployment UUID belonging to that work and environment. Rollback changes the active code version; it does not undo earlier side effects or restore records.

## Inspect data and runs

| Tool | Arguments | Result |
| --- | --- | --- |
| `list_collections` | `{}` | Collections grouped by feature and environment. |
| `read_collection` | `{ feature, collection, environment, after? }` | A page of up to 50 records. Pass nextCursor as after for the next page. |
| `list_runs` | `{}` | Latest 50 executions with status and timing. Inputs and outputs are not retained. |
| `get_run` | `{ runId }` | Exact deployed source, run status, response status, bounded logs, and redacted error details. |

## Handle tool errors

Failed tool calls return `isError: true` and a JSON error object containing a code and message. Invocation errors include `runId` once execution has started. Use it with `get_run`. Validation and admission failures before execution do not create a run.

There is no delete-work MCP tool. A merchant can delete a paused work from its detail page in Shopify admin. Stored data, versions, and run history remain. See [Manage works](https://littleworks.app/docs/operations#manage-works).

## Connection details

The endpoint is `/mcp/STORE_ID`, served over Streamable HTTP. OAuth uses mandatory S256 PKCE, exact registered callbacks, and resource-bound tokens. Dynamic client registration is supported; URL-based client metadata documents are not currently supported.

Access tokens last one hour; refresh tokens rotate. Grants expire after 90 days. Disconnecting invalidates that grant’s tokens immediately. Clients should use their supported OAuth flow rather than asking the merchant to handle tokens manually.
