Skip to main content
Glama

getSubgraphSchema

Fetch the GraphQL schema for any subgraph on The Graph network to understand available queries, types, and data structures for blockchain data exploration.

Instructions

Fetch the schema of a specified subgraph using GraphQL introspection.

Args: subgraphId (str): The ID of the subgraph to query. asText (bool): If True, return schema as GraphQL text; otherwise, return JSON.

Returns: str: Schema in JSON or GraphQL text format, or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subgraphIdYes
asTextNo
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool fetches schema via GraphQL introspection and returns data in JSON or text format, but doesn't cover critical aspects like error handling (e.g., what happens if the subgraphId is invalid), authentication needs, rate limits, or whether it's a read-only operation. This leaves significant gaps for an agent to understand its behavior.

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?

The description is well-structured and front-loaded with the core purpose, followed by clear sections for arguments and returns. Every sentence adds value: the first explains the tool's function, and the subsequent lines detail parameters and output without redundancy. It's appropriately sized for a tool with two parameters.

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?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and parameters effectively, but lacks details on behavioral aspects like error conditions or usage context. Without annotations or output schema, it doesn't fully equip an agent for reliable invocation.

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?

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains that 'subgraphId' identifies the subgraph to query and 'asText' controls the output format (JSON vs. GraphQL text), clarifying the purpose and effect of each parameter. This compensates well for the lack of schema descriptions.

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?

The description clearly states the tool's purpose: 'Fetch the schema of a specified subgraph using GraphQL introspection.' It specifies the verb ('fetch'), resource ('schema of a specified subgraph'), and method ('GraphQL introspection'), but doesn't explicitly differentiate from sibling tools like 'querySubgraph' or 'searchSubgraphs' beyond the schema focus.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'querySubgraph' or 'searchSubgraphs'. It lacks context about prerequisites, such as whether the subgraph must exist or be accessible, and doesn't mention any exclusions or specific scenarios for its use.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Data-Nexus-Web3/thegraph-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server