Skip to main content
Glama

Query a project code graph

memory_graph_query
Read-onlyIdempotent

Query the code graph of a project: where a symbol is defined and who imports it, or a file's definitions, imports and importers; with neither, the most imported files.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project": "<project>"
    },
    "name": "memory_graph_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNo
symbolNo
projectYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already establish the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description's main added value is disclosing the default behavior when neither file nor symbol is supplied. It says nothing about result size, truncation, or ordering of the "most imported" ranking.

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?

A single front-loaded sentence with a compact three-mode structure and no filler. The semicolon-delimited clauses are dense but still parseable in one pass.

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

Completeness4/5

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

For a read-only, three-parameter query tool with no output schema, the description covers the meaningful return modes and the no-argument default. The remaining gaps (indexing prerequisite, output limits) are modest rather than blocking.

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?

Schema description coverage is 0%, so the description must carry parameter meaning; it does map symbol and file to distinct query modes and implies project scopes the graph. It does not clarify the expected format of project (id vs name vs path), whether symbol must be fully qualified, or how file paths should be expressed.

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 uses a specific verb plus resource ("Query the code graph of a project") and spells out what is returned in each mode: a symbol's definition and importers, a file's definitions/imports/importers, or the most-imported files. It does not explicitly name the sibling memory_graph_index to separate query from indexing, but the query-vs-index distinction is legible from the verbs.

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

Usage Guidelines4/5

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

It gives clear conditional guidance for selecting inputs: pass a symbol for definitions/importers, a file for file-level structure, and neither for the most-imported files. It stops short of stating prerequisites (a project presumably must be indexed first via memory_graph_index) or when not to use this tool.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources