Skip to main content
Glama

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

NameRequiredDescriptionDefault
apiYesThe GraphQL API to validate against. Valid options are: Default is 'admin'.admin
versionYesThe version of the API to validate against. MUST be one of Default is 'undefined'.
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses that the tool returns a comprehensive validation result with per-code-block explanations and why that detail matters, which is useful behavioral context, but it says nothing about side effects, permissions, or idempotency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is three sentences and front-loads the purpose before usage and return-value context. The final sentence about why detail is provided is slightly verbose but still earns its place by explaining the output's intent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema, and the description explains the shape and purpose of the validation result. Required parameters and the learn_shopify_api dependency are fully covered by the schema, so the definition is complete enough for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the four parameters, enum values, and the conversationId prerequisite are already documented in the schema. The description adds no parameter-level meaning beyond that baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: validating GraphQL code blocks against the Shopify GraphQL schema for hallucinated fields or operations. It is clear what the tool does, though it does not explicitly differentiate itself by name from siblings such as introspect_graphql_schema or fetch_full_docs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit trigger: use this tool whenever a user asks an LLM to generate a GraphQL operation. It does not state when not to use it or name alternatives for adjacent needs, so it falls short of full when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.