Skip to main content
Glama

Introspect Schema

introspect_schema
Read-onlyIdempotent

Fetch a subgraph's GraphQL schema via standard introspection. Returns types, fields, and arguments so an agent can build queries without external docs. Requires your own The Graph API key, passed as _apiKey.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "_apiKey": "your-thegraph-api-key",
      "subgraph_id": "5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV"
    },
    "name": "introspect_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
_apiKeyYesYour own The Graph API key (BYO, Pipeworx does not supply one). Free 100k queries/month after signup at https://thegraph.com/studio/apikeys.
subgraph_idYesSubgraph deployment ID

Output Schema

NameRequiredDescriptionDefault
enumsYesList of enum types
objectsYesList of object types with fields
enum_countYesNumber of enum types in schema
query_typeYesRoot query type name
subgraph_idYesSubgraph deployment ID
object_countYesNumber of object types in schema

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / _apiKey / description
      Previous value: -"Your own The Graph API key (BYO — Pipeworx does not supply one). Free 100k queries/month after signup at https://thegraph.com/studio/apikeys."New value: +"Your own The Graph API key (BYO, Pipeworx does not supply one). Free 100k queries/month after signup at https://thegraph.com/studio/apikeys."
  2. Changed3 schema fields changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "subgraph_id": "5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV"
      -  }
      -]New value: +[
      +  {
      +    "_apiKey": "your-thegraph-api-key",
      +    "subgraph_id": "5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV"
      +  }
      +]
    • addedInput schema / properties / _apiKey
      Added value: +{
      +  "description": "Your own The Graph API key (BYO — Pipeworx does not supply one). Free 100k queries/month after signup at https://thegraph.com/studio/apikeys.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "subgraph_id"
      -]New value: +[
      +  "subgraph_id",
      +  "_apiKey"
      +]
  3. Changed2 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "subgraph_id": "5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV"
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "enum_count": {
      +      "description": "Number of enum types in schema",
      +      "type": "integer"
      +    },
      +    "enums": {
      +      "description": "List of enum types",
      +      "items": {
      +        "properties": {
      +          "name": {
      +            "description": "Enum type name",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "values": {
      +            "description": "Enum value names",
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "object_count": {
      +      "description": "Number of object types in schema",
      +      "type": "integer"
      +    },
      +    "objects": {
      +      "description": "List of object types with fields",
      +      "items": {
      +        "properties": {
      +          "description": {
      +            "description": "Type description",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "fields": {
      +            "description": "Fields in this type",
      +            "items": {
      +              "properties": {
      +                "args": {
      +                  "description": "Field arguments",
      +                  "items": {
      +                    "properties": {
      +                      "name": {
      +                        "description": "Argument name",
      +                        "type": [
      +                          "string",
      +                          "null"
      +                        ]
      +                      },
      +                      "type": {
      +                        "description": "Argument type signature",
      +                        "type": "string"
      +                      }
      +                    },
      +                    "type": "object"
      +                  },
      +                  "type": "array"
      +                },
      +                "description": {
      +                  "description": "Field description",
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "name": {
      +                  "description": "Field name",
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "type": {
      +                  "description": "Field type signature (flattened)",
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "name": {
      +            "description": "Type name",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "query_type": {
      +      "description": "Root query type name",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "subgraph_id": {
      +      "description": "Subgraph deployment ID",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "subgraph_id",
      +    "query_type",
      +    "object_count",
      +    "enum_count",
      +    "objects",
      +    "enums"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, open-world behavior, so the safety profile is covered. The description adds the auth requirement (own The Graph API key), but that is also spelled out in the _apiKey schema property, so the marginal gain is small; nothing is said about response size for large schemas or failure modes on bad IDs.

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 compact sentences: what it does, why it matters, and the hard prerequisite. The API-key blocker is front-loaded before an agent commits to the call, and there is no filler.

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?

An output schema exists, so return values need no elaboration, and both required params plus the auth prerequisite are covered. What is missing is small but real: no guidance on the size/latency of introspection responses or how errors surface for an invalid subgraph_id.

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%, with both required parameters fully documented including the BYO-key signup link. The description's '_apiKey' mention adds no syntax or format meaning beyond the schema, so the baseline of 3 applies.

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 — fetching a subgraph's GraphQL schema via introspection — and what comes back (types, fields, arguments). It implies a build-then-query workflow but never names query_subgraph explicitly, so the sibling differentiation is inferred rather than stated.

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?

'so an agent can build queries without external docs' gives a clear context for when this tool is the right call. It stops short of an explicit alternative or exclusion, such as 'use this before query_subgraph instead of guessing field names.'

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.