# validate_theme

This tool validates Liquid codeblocks, Liquid files, and supporting Theme files (e.g. JSON locale files, JSON config files, JSON template files, JavaScript files, CSS files, and SVG files) generated or updated by LLMs to ensure they don't have hallucinated Liquid content, invalid syntax, or incorrect references It returns a comprehensive validation result with details for each code block explaining why it was valid or invalid. This detail is provided so LLMs know how to modify code snippets to remove errors. It also returns an artifact ID and revision number for each code block. This is used to track the code block and its validation results. When validating an iteration of the same code block, use the same artifact ID and increment the revision number. Do not pass your own artifact ID to this tool, the tool will generate one for you.. Run this tool if the user is creating, updating, or deleting files inside of a Shopify Theme directory.

Agent View of the PolicyLayer registry record for `validate_theme`. HTML page: https://policylayer.com/tools/dev/validate-theme

## Facts

- Tool: `validate_theme`
- Server: Dev (`@shopify/dev-mcp`) — https://policylayer.com/tools/dev.md
- Install: `npx -y @shopify/dev-mcp`
- Homepage: https://www.npmjs.com/package/@shopify/dev-mcp
- Risk category: Read (Low risk)
- Registry record: grade D, identity unverified
- Server rate-limited: no
- Parameters: 3 (3 required)
- Recommended policy verdict: Allowed

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `conversationId` | string | yes | 🔗 REQUIRED: conversationId from learn_shopify_api tool. Call learn_shopify_api first if you don't have this. |
| `absoluteThemePath` | string | yes | The absolute path to the theme directory |
| `filesCreatedOrUpdated` | array | yes | Array of files with path and optional artifact metadata |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "validate_theme",
    "arguments": {
      "conversationId": "<conversationId>",
      "absoluteThemePath": "<absoluteThemePath>",
      "filesCreatedOrUpdated": []
    }
  }
}
```

## Why validate_theme is rated Low

This is a validation/linting tool that analyzes code and provides feedback without making changes. It performs static analysis on Liquid, JSON, JavaScript, CSS, and SVG files to check for syntax errors and invalid references. The output is informational (validation results with artifact IDs), with no side effects or state modifications.

From the tool's own definition: "The tool description states it 'validates' and 'returns a comprehensive validation result' with details about whether code blocks are valid or invalid. Key verbs: 'validates', 'returns', 'ensures'."

Risk signals: Accepts file system path (filesCreatedOrUpdated[].path)

## Use case

AI agents call validate_theme to retrieve information from Dev without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Dev:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "validate_theme": {}
  }
}
```

## Other tools on Dev (4)

- `learn_shopify_api` — Read — https://policylayer.com/tools/dev/learn-shopify-api.md
- `search_docs_chunks` — Read — https://policylayer.com/tools/dev/search-docs-chunks.md
- `validate_component_codeblocks` — Read — https://policylayer.com/tools/dev/validate-component-codeblocks.md
- `validate_graphql_codeblocks` — Read — https://policylayer.com/tools/dev/validate-graphql-codeblocks.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=dev · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/dev
