Skip to main content
Glama

validate_graphql_codeblocks

Validates GraphQL code blocks against the Storefront schema and flags runtime pitfalls like invalid cart IDs before queries reach the browser.

Instructions

Check GraphQL against the Storefront schema before it reaches a browser.

Always run generated queries and mutations through this. The schema is large and has many close names, and an invented field looks entirely plausible until it fails.

Beyond schema validity it flags mistakes that validate cleanly and still fail at runtime, such as a numeric cart id or reading delivery before the cart has an address, and it answers names borrowed from other storefront APIs with the CloudCart one.

Input Schema

NameRequiredDescriptionDefault
apiNoWhich schema to validate against.storefront
codeblocksYesThe code blocks to check.
conversationIdYesFrom learn_cloudcart_storefront.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses that validation goes beyond syntax to semantic runtime errors (numeric cart id, reading delivery before an address exists) and that it maps names borrowed from other storefront APIs to CloudCart equivalents. The main gap is that it never describes the shape or content of the validation response.

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

Conciseness5/5

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

Three short paragraphs, front-loaded with the core action, followed by a usage mandate and then the differentiating value. Every sentence is doing work; nothing is redundant with the name or schema.

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?

Given a simple 3-parameter read-only tool with no output schema, the description covers purpose, timing, and the unexpected extra behaviors well. It is nearly complete, but the absence of any statement about what comes back (error list, corrected code, suggestions) leaves a modest informational gap.

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 api, codeblocks, conversationId, and the nested artifactId/revision fields are already documented. The description adds no parameter-level detail (e.g., what a valid conversationId links to or how multiple blocks are reported), so the baseline 3 applies.

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

Purpose5/5

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

States a specific verb (validate/check) and resource (GraphQL codeblocks against the Storefront schema), plus the timing rationale ('before it reaches a browser'). It is clearly distinct from its siblings learn_cloudcart_storefront and introspect_graphql_schema, which supply context and schema rather than checking artifacts.

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?

Explicit and prescriptive: 'Always run generated queries and mutations through this' tells the agent exactly when to invoke it, and the 'invented field looks plausible' rationale motivates the habit. It doesn't name alternative tools or state when-not-to-use, so it falls short of a 5.

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