Skip to main content
Glama
PaulieB14

Limitless MCP

query_subgraph

Execute custom GraphQL queries on Limitless subgraphs to retrieve specific on-chain data when standard tools don't meet your needs.

Instructions

Run a raw GraphQL query against a Limitless subgraph. Escape hatch for custom queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subgraphYesWhich subgraph
queryYesGraphQL query string

Implementation Reference

  • The handler function for the `query_subgraph` tool, which delegates to `querySimple` or `queryNegRisk`.
      async ({ subgraph, query }) => {
        try {
          const data =
            subgraph === "simple"
              ? await querySimple(query)
              : await queryNegRisk(query);
          return textResult(data);
        } catch (e) {
          return errorResult(e);
        }
      }
    );
  • Registration of the `query_subgraph` tool in the MCP server.
    server.registerTool(
      "query_subgraph",
      {
        description:
          "Run a raw GraphQL query against a Limitless subgraph. Escape hatch for custom queries.",
        inputSchema: {
          subgraph: z.enum(["simple", "negrisk"]).describe("Which subgraph"),
          query: z.string().describe("GraphQL query string"),
        },
      },
  • The underlying `querySubgraph` function and helpers (`querySimple`, `queryNegRisk`) that execute the GraphQL queries.
    export async function querySubgraph(
      endpoint: string,
      query: string,
      variables?: Record<string, unknown>
    ): Promise<any> {
      const body: Record<string, unknown> = { query };
      if (variables && Object.keys(variables).length > 0) {
        body.variables = variables;
      }
    
      const response = await fetch(endpoint, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(body),
      });
    
      if (!response.ok) {
        throw new Error(`Subgraph returned HTTP ${response.status}: ${response.statusText}`);
      }
    
      const json = (await response.json()) as { data?: any; errors?: any[] };
    
      if (json.errors && json.errors.length > 0) {
        throw new Error(`GraphQL errors: ${JSON.stringify(json.errors)}`);
      }
    
      return json.data;
    }
    
    export async function querySimple(query: string, variables?: Record<string, unknown>) {
      return querySubgraph(SIMPLE_ENDPOINT, query, variables);
    }
    
    export async function queryNegRisk(query: string, variables?: Record<string, unknown>) {
      return querySubgraph(NEGRISK_ENDPOINT, query, variables);
    }
Behavior2/5

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

No annotations provided, so description carries full burden. While it identifies the operation as 'raw GraphQL', it fails to disclose if mutations are permitted, what return format to expect, rate limits, or authentication requirements for direct subgraph access.

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?

Extremely concise with two high-value sentences. Front-loaded with action verb ('Run'), zero redundancy, and the 'escape hatch' metaphor efficiently conveys usage intent without verbosity.

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?

Adequate for a two-parameter tool with complete schema coverage, but misses opportunity to reference sibling 'get_subgraph_schema' for query construction or clarify output format given the 'raw' nature of the response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3. The description mentions 'GraphQL query' and 'subgraph', confirming the parameter purposes, but adds no additional semantic detail about query syntax, validation, or the enum values ('simple' vs 'negrisk').

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?

States specific action ('Run a raw GraphQL query') and resource ('Limitless subgraph'). The term 'escape hatch' effectively distinguishes this from specific getter siblings by implying it's for custom/advanced use cases.

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?

'Escape hatch for custom queries' provides implied context for when to use this tool (non-standard queries), but lacks explicit guidance on when to prefer specific siblings like get_conditions or how to construct valid queries.

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/PaulieB14/limitless-subgraphs'

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