Skip to main content
Glama

querySubgraph

Execute GraphQL queries against specific subgraphs to retrieve indexed blockchain data from The Graph network.

Instructions

Execute a GraphQL query against a specified subgraph.

Args: subgraphId (str): The ID of the subgraph to query. query (str): The GraphQL query string to execute.

Returns: str: Query result in JSON format, or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subgraphIdYes
queryYes
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool returns 'Query result in JSON format, or an error message,' which adds some context about output behavior. However, it lacks details on authentication needs, rate limits, performance characteristics, or what happens on invalid inputs, which are important for a mutation-like query execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the main purpose in the first sentence. The Args and Returns sections are structured clearly, but the formatting with markdown-like sections could be slightly more concise if integrated into a single paragraph.

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 complexity of executing GraphQL queries, no annotations, no output schema, and 2 parameters, the description is moderately complete. It covers the basic purpose and parameters but lacks details on error types, response structure beyond 'JSON format,' and integration with sibling tools, leaving gaps for effective agent use.

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 meaning beyond the input schema by explaining that 'subgraphId' is 'The ID of the subgraph to query' and 'query' is 'The GraphQL query string to execute.' With 0% schema description coverage, this compensates well by clarifying the purpose of each parameter, though it doesn't specify format constraints or examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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: 'Execute a GraphQL query against a specified subgraph.' This includes a specific verb ('Execute'), resource ('GraphQL query'), and target ('specified subgraph'), which distinguishes it from sibling tools like getSubgraphSchema (which retrieves schema) and searchSubgraphs (which searches for subgraphs).

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

Usage Guidelines3/5

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

The description implies usage by specifying it's for executing GraphQL queries, but it doesn't explicitly state when to use this tool versus alternatives like getSubgraphSchema or searchSubgraphs. There's no guidance on prerequisites, error handling, or specific contexts where this tool is preferred over others.

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