New Your team’s decisions, in one playbook every coding agent works from. Never answer your agent twice

validate_component_codeblocks

🚨 MANDATORY VALIDATION TOOL - MUST BE CALLED WHEN COMPONENTS FROM SHOPIFY PACKAGES ARE USED. DONT ASK THE USER TO DO THIS. DON'T CONTEXT SWITCH. This tool MUST be used to validate ALL code blocks containing Shopify components, regardless of size or complexity. ⚠️ CRITICAL REQUIREMENTS: - Call th...

SERVERDev SOURCE@shopify/dev-mcp
Low RISK CLASS
Category Read
Parameters 53 required
Recommended Allowedsee the rule below
Registry record Grade D, identity unverified Pull the record →

This record as markdown: /tools/dev/validate-component-codeblocks.md

What validate_component_codeblocks does on Dev

AI agents call validate_component_codeblocks 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.

ParameterTypeRequiredDescription
api string Yes API name to validate against (e.g., 'pos-ui', 'polaris-app-home').
code array Yes Array of code blocks with content and optional artifact metadata. Supported code blocks are JS/TS React, vanilla JS/TS, Preact, and raw HTML Polaris web compone
version string The API version to validate against (e.g., '2026-01', '2025-10'). Pass the version you detected or passed search_docs_chunks. When omitted, defaults to the late
conversationId string Yes 🔗 REQUIRED: conversationId from learn_shopify_api tool. Call learn_shopify_api first if you don't have this.
extensionTarget string Required for extension surface APIs (polaris-admin-extensions, polaris-checkout-extensions, polaris-customer-account-extensions, pos-ui). The extension target d

Parameters from the server's own tool schema.

Why validate_component_codeblocks is rated Low

This tool reads and analyzes code to validate it against known Shopify component schemas. It does not create, modify, delete, execute, or initiate any external operations. It is purely a linting/validation utility that returns analysis results. The mandatory nature and emphasis on calling it does not change its fundamental operation: inspection without side effects.

From the tool's definition Tool performs validation by checking code blocks against Shopify component specifications. The description states it 'validate[s]' and 'prevents hallucinated components' - these are inspection and verification operations with no side effects on data or…

Risk signalsAccepts freeform code/query input (code) · Accepts raw HTML/template content (code[].content)

Questions about validate_component_codeblocks

What does the validate_component_codeblocks tool do? +

🚨 MANDATORY VALIDATION TOOL - MUST BE CALLED WHEN COMPONENTS FROM SHOPIFY PACKAGES ARE USED. DONT ASK THE USER TO DO THIS. DON'T CONTEXT SWITCH. This tool MUST be used to validate ALL code blocks containing Shopify components, regardless of size or complexity. ⚠️ CRITICAL REQUIREMENTS: - Call this tool IMMEDIATELY after generating ANY Shopify component code - NEVER skip validation, even for simple examples or snippets - ALWAYS use this tool when generating JSX, TSX, or web component code - This validation prevents hallucinated components, props, and prop values - Your major tasks while structuring the input is to ensure that: 1. If the code contains JS/TS code, it should be wrapped inside a function. 2. All Javascript code is outside return statement of the function. 3. All the polaris web components are in return statement of the function. INPUT STRUCTURE: Do not pass in tiny snippets of code. Follow the example given below as the input to validate_component_codeblocks tool. { "api": "The API name (e.g., 'polaris-app-home', 'pos-ui')", "code": [ { "content": " const Extension = () => { const [isConnected, setIsConnected] = useState( shopify.connectivity.current.value.internetConnected === 'Connected' ); useEffect(() => { const unsubscribe = shopify.connectivity.current.subscribe((newConnectivity) => { setIsConnected(newConnectivity.internetConnected === 'Connected'); }); return unsubscribe; }, []); return ( <s-tile heading="My App" disabled={!isConnected} /> ); }; " } ] } 📤 OUTPUTS: - Comprehensive validation results with specific error details - Clear guidance on how to fix any validation failures - Component-by-component validation status 🔄 WORKFLOW: Generate Code → Validate → Fix Errors and replace code → Re-validate if needed 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. It is categorised as a Read tool in the Dev MCP Server, which means it retrieves data without modifying state.

What parameters does validate_component_codeblocks accept? +

validate_component_codeblocks accepts 5 parameters: api, code, version, conversationId, extensionTarget. Required: api, code, conversationId. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on validate_component_codeblocks? +

Register the Dev MCP server in PolicyLayer and add a rule for validate_component_codeblocks: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Dev. Nothing to install.

What risk level is validate_component_codeblocks? +

validate_component_codeblocks is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit validate_component_codeblocks? +

Yes. Add a rate_limit block to the validate_component_codeblocks rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block validate_component_codeblocks completely? +

Set action: deny in the PolicyLayer policy for validate_component_codeblocks. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides validate_component_codeblocks? +

validate_component_codeblocks is provided by the Dev MCP server (@shopify/dev-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

More on Dev, and thousands of servers like it.

This server

Across the catalogue

// THE MCP REGISTRY

PolicyLayer tracks 44,603 MCP servers and 515,000+ tools.

Every server has a live record: who publishes it, whether it answers without auth, its risk grade, every tool classified, the recommended policy. This page is one line of Dev's. Pull the full record:

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.