get_subgraph_schema
Retrieve the complete GraphQL schema for any Polymarket subgraph to understand available queries and data structures.
Instructions
Get the full GraphQL schema (introspection) for a Polymarket subgraph
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subgraph | Yes | Subgraph identifier: main, beefy_pnl, slimmed_pnl, activity, or orderbook |
Implementation Reference
- src/index.ts:69-100 (registration)Registration of the 'get_subgraph_schema' tool with its input schema and handler
server.registerTool( "get_subgraph_schema", { description: "Get the full GraphQL schema (introspection) for a Polymarket subgraph", inputSchema: { subgraph: z .enum(SUBGRAPH_NAMES) .describe("Subgraph identifier: main, beefy_pnl, slimmed_pnl, activity, or orderbook"), }, }, async ({ subgraph }) => { try { const cfg = SUBGRAPHS[subgraph]; const introspectionQuery = `{ __schema { types { name kind fields { name type { name kind ofType { name kind } } } } } }`; const data = await querySubgraph(cfg.ipfsHash, introspectionQuery); return textResult(data); } catch (error) { return errorResult(error); } } );