Skip to main content
Glama

validate_graphql_codeblocks

Validates GraphQL code blocks against the Storefront schema, flagging invalid fields and runtime-prone mistakes before queries or mutations reach a 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.

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": {
      "codeblocks": "<codeblocks>",
      "conversationId": "<conversationId>"
    },
    "name": "validate_graphql_codeblocks"
  }
}

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. Changed3 schema fields changedv0.3.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / codeblocks / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / codeblocks / items / properties / revision / maximum
      Added value: +9007199254740991
  2. 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 full burden and does substantial work: it discloses two validation layers (schema validity plus runtime-failure heuristics like numeric cart ids and reading delivery before an address) and that foreign-API names get translated. It does not describe how results are returned — error format, severity, or whether corrected code is echoed back — which is a meaningful gap for a validation tool.

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?

Front-loaded with the verb and resource, followed by the imperative usage rule, then the justification for why validation matters. Three short paragraphs, none of which restate structured fields or waste words.

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?

For a tool with no annotations and no output schema, the description covers what it checks and why, which is the bulk of what an agent needs. The remaining gap is the result contract — what the agent receives back and how to act on failures beyond the revision/artifactId retry hints already in the schema.

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 coverage is 100% and the schema already documents api, codeblocks, content, revision, artifactId, and conversationId in detail. The description adds no parameter-level information beyond mentioning that queries and mutations are accepted, so the baseline of 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 and resource — checking GraphQL queries and mutations against the Storefront schema before browser execution — which goes beyond restating the name. It implicitly separates itself from introspect_graphql_schema by framing the tool as a validation gate rather than a lookup, and from learn_cloudcart_storefront by referencing that tool only as the source of conversationId.

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?

"Always run generated queries and mutations through this" is an explicit, directive when-to-use rule tied to a workflow stage (before it reaches a browser). It does not name an alternative or state when to skip it, so it falls short of a full routing instruction.

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