validate_graphql_codeblocks
Validates GraphQL code blocks against the Shopify schema to catch invalid or hallucinated fields and operations, returning per-block errors that guide corrections.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"conversationId": "<conversationId>",
"api": "<api>",
"version": "<version>",
"codeblocks": "<codeblocks>"
},
"name": "validate_graphql_codeblocks"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api | Yes | The GraphQL API to validate against. Valid options are: Default is 'admin'. | admin |
| version | Yes | The version of the API to validate against. MUST be one of Default is 'undefined'. | |
| 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. |