introspect_schema

Pack: the-graph · Endpoint: https://gateway.pipeworx.io/the-graph/mcp

Fetch a subgraph’s GraphQL schema via standard introspection. Returns types, fields, and arguments so an agent can build queries without external docs.

Parameters

NameTypeRequiredDescription
subgraph_idstringyesSubgraph deployment ID

Example call

Arguments

{
  "subgraph_id": "5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV"
}

curl

curl -X POST https://gateway.pipeworx.io/the-graph/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"introspect_schema","arguments":{"subgraph_id":"5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('introspect_schema', {
  "subgraph_id": "5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV"
});

Response shape

Always returns: subgraph_id, query_type, object_count, enum_count, objects, enums

FieldTypeDescription
subgraph_idstringSubgraph deployment ID
query_typestring | nullRoot query type name
object_countintegerNumber of object types in schema
enum_countintegerNumber of enum types in schema
objectsarrayList of object types with fields
enumsarrayList of enum types
Full JSON Schema
{
  "type": "object",
  "properties": {
    "subgraph_id": {
      "type": "string",
      "description": "Subgraph deployment ID"
    },
    "query_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "Root query type name"
    },
    "object_count": {
      "type": "integer",
      "description": "Number of object types in schema"
    },
    "enum_count": {
      "type": "integer",
      "description": "Number of enum types in schema"
    },
    "objects": {
      "type": "array",
      "description": "List of object types with fields",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Type name"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Type description"
          },
          "fields": {
            "type": "array",
            "description": "Fields in this type",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Field name"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Field description"
                },
                "type": {
                  "type": "string",
                  "description": "Field type signature (flattened)"
                },
                "args": {
                  "type": "array",
                  "description": "Field arguments",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Argument name"
                      },
                      "type": {
                        "type": "string",
                        "description": "Argument type signature"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "enums": {
      "type": "array",
      "description": "List of enum types",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Enum type name"
          },
          "values": {
            "type": "array",
            "description": "Enum value names",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "required": [
    "subgraph_id",
    "query_type",
    "object_count",
    "enum_count",
    "objects",
    "enums"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "the-graph": {
      "url": "https://gateway.pipeworx.io/the-graph/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build July 6, 2026