Skip to main content
Glama

query_graphql

Run GraphQL queries on the code graph to fetch nested data with pagination. Ideal for retrieving nodes, edges, and graph traversal results in a single query.

Instructions

Execute a GraphQL query on the code graph.

GraphQL provides typed, nested queries with pagination — complementary to Datalog. Use GraphQL when you need nested data in one query (node + edges + neighbors). Use Datalog (query_graph) for pattern matching and logical rules.

SCHEMA HIGHLIGHTS:

  • node(id: ID!): Node — get a single node

  • nodes(filter: {type, name, file, exported}, first, after): NodeConnection — paginated search

  • bfs/dfs(startIds, maxDepth, edgeTypes): [ID!]! — graph traversal

  • reachability(from, to, edgeTypes, maxDepth): Boolean — path existence

  • datalog(query, limit, offset): DatalogResult — Datalog passthrough

  • findCalls(target, className): [CallInfo!]! — call graph

  • traceDataFlow(source, file, direction, maxDepth): [[String!]!]! — data flow

  • stats: GraphStats — node/edge counts

Node fields: id, name, type, file, line, column, exported, metadata, outgoingEdges(types), incomingEdges(types), children, parent

EXAMPLE: query { nodes(filter: {type: "FUNCTION", file: "src/api"}, first: 5) { edges { node { name, file, line outgoingEdges(types: ["CALLS"]) { edges { node { dst { name, file } } } } } } totalCount } }

Use get_documentation(topic="graphql-schema") for the full schema.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesGraphQL query string
variablesNoOptional variables for the query (JSON object)
operationNameNoOptional operation name (when query contains multiple operations)
Behavior4/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. It describes the behavior thoroughly: query execution, pagination, available query types (node, nodes, bfs, etc.), and node fields. However, it does not explicitly state that the tool is read-only or mention any side effects, though it is implied.

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 moderately concise given the amount of information. It is well-structured with sections, bullet points, and an example. Every part serves a purpose, and key information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a GraphQL query tool with 100% schema coverage and no output schema, the description is very complete. It lists all available top-level queries, node fields, and provides an example. It also references get_documentation for the full schema, covering any remaining gaps.

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?

Schema description coverage is 100% (all three parameters are described in the input schema). The description adds value beyond the schema by providing schema highlights, node field details, and an example query, which help the agent understand how to construct queries.

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 'Execute a GraphQL query on the code graph' with a specific verb and resource, and distinguishes itself from the sibling tool 'query_graph' (Datalog) by explaining when to use each.

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

Usage Guidelines5/5

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

Explicitly provides usage guidance: 'Use GraphQL when you need nested data... Use Datalog (query_graph) for pattern matching...' and includes a pointer to get_documentation for the full schema, giving clear context on when to use this tool vs alternatives.

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/Disentinel/grafema'

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