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
Name | Required | Description | Default |
---|---|---|---|
api | No | The 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 |
codeblocks | Yes | Array of GraphQL code blocks to validate | |
conversationId | Yes | 🔗 REQUIRED: conversationId from learn_shopify_api tool. Call learn_shopify_api first if you don't have this. | |
version | No | 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' Default is '2025-07'. | 2025-07 |