Skip to main content
Glama

graphql-cost

GraphQL depth and static complexity score — Parses a GraphQL document (query, mutation or subscription) per the June 2018 spec and returns depth, field count, alias count, fragment list, cycle detection and a static complexity score. Complexity uses the common 'Σ field-score × list-multiplier' model: a listFields config maps parent-type + field-name to either a constant multiplier or a field argument name to read (e.g. 'first', 'limit'), wi

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": {
      "query": "<query>"
    },
    "name": "graphql-cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe GraphQL document text.
maxDepthNoFail if depth exceeds this. Default 15.
variablesNoVariable values, used only to resolve list-argument multipliers like first: $first.
listFieldsNoPer-type field multiplier config. See description for shape.
maxComplexityNoFail if complexity exceeds this. Default 1000.
operationNameNoPick this operation; defaults to the first.
defaultListMultiplierNoFallback multiplier for list fields not declared in listFields. Default 10.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/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 reasonably well: it names the spec version parsed against, enumerates the computed outputs, and explains the complexity model (Σ field-score × list-multiplier) plus how listFields drives it. It omits whether the tool is purely computational/side-effect free and says nothing about error behavior beyond the schema's 'fail if exceeds' hints.

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

Conciseness3/5

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

The opening clause is well front-loaded, but the text is one long run-on sentence that terminates mid-word ('wi'), leaving the most technical part of the explanation incomplete. The truncation is a structural defect, not just verbosity.

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

Completeness3/5

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

For a 7-parameter tool with no output schema, the description does a fair job enumerating return values and the complexity model. However, the schema defers to the description for the listFields shape ('See description for shape') and the description is truncated exactly there, leaving a required piece of configuration semantics unresolved.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining the listFields config shape (parent-type + field-name to constant multiplier or argument name) and clarifying that variables exist only to resolve list-argument multipliers. The explanation is cut off mid-word, so the listFields shape is only partially conveyed.

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?

States a specific verb and resource: parses a GraphQL document (query, mutation or subscription) and returns depth, field count, alias count, fragments, cycle detection and a static complexity score. That is far more specific than the name alone. It does not need to distinguish itself from siblings, since none of the listed tools overlap, but it also never frames itself against any alternative.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is for measuring GraphQL query cost before execution, but the description never says when to reach for it, when not to, or what to do instead. No prerequisites or exclusions are stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources