Skip to main content
Glama

Shopify Dev MCP

Official
by Shopify

validate_graphql_codeblocks

Validate GraphQL code blocks against the Shopify GraphQL schema to detect and correct hallucinated fields or operations. Provides detailed validation results to guide LLMs in generating accurate and error-free code snippets.

Instructions

This tool validates GraphQL code blocks against the Shopify GraphQL schema to ensure they don't contain hallucinated fields or operations. If a user asks for an LLM to generate a GraphQL operation, this tool should always be used to ensure valid code was generated.

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.

Input Schema

NameRequiredDescriptionDefault
apiNoThe GraphQL API to validate against. Valid options are: - 'admin': The Admin API is the primary API for managing your Shopify store. It allows you to create and manage products, orders, customers, and more. Default is 'admin'.admin
codeblocksYesArray of GraphQL code blocks to validate
conversationIdYes🔗 REQUIRED: conversationId from learn_shopify_api tool. Call learn_shopify_api first if you don't have this.
versionNoThe version of the API to validate against. MUST be one of '2024-10' or '2025-01' or '2025-04' or '2025-07' or 'unstable' Default is '2025-07'.2025-07

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "api": { "default": "admin", "description": "The GraphQL API to validate against. Valid options are:\n- 'admin': The Admin API is the primary API for managing your Shopify store. It allows you to create and manage products, orders, customers, and more.\nDefault is 'admin'.", "enum": [ "admin" ], "type": "string" }, "codeblocks": { "description": "Array of GraphQL code blocks to validate", "items": { "type": "string" }, "type": "array" }, "conversationId": { "description": "🔗 REQUIRED: conversationId from learn_shopify_api tool. Call learn_shopify_api first if you don't have this.", "type": "string" }, "version": { "default": "2025-07", "description": "The version of the API to validate against. MUST be one of '2024-10' or '2025-01' or '2025-04' or '2025-07' or 'unstable'\nDefault is '2025-07'.", "enum": [ "2024-10", "2025-01", "2025-04", "2025-07", "unstable" ], "type": "string" } }, "required": [ "conversationId", "codeblocks" ], "type": "object" }
Install Server

Other Tools from Shopify Dev MCP

Related Tools

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/Shopify/dev-mcp'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server