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
| Name | Type | Required | Description |
|---|---|---|---|
subgraph_id | string | yes | Subgraph 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
| Field | Type | Description |
|---|---|---|
subgraph_id | string | Subgraph deployment ID |
query_type | string | null | Root query type name |
object_count | integer | Number of object types in schema |
enum_count | integer | Number of enum types in schema |
objects | array | List of object types with fields |
enums | array | List 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.