Skip to main content
Glama

graph_query

Read-onlyIdempotent

Query the code knowledge graph for callers, callees, inheritance, imports, paths, and neighborhoods to answer relationship questions standard usage or impact analysis misses.

Instructions

Raw access to the code knowledge graph (calls, inheritance, imports), for what find_usages, impact and describe_symbol do not cover. operation: callers | callees | subclasses | superclasses | imports | neighbors | shortest_path | overview | surprising_connections | status | audit (symbol = a C# package folder: SOLID findings, each with its refactor fence). symbol is matched as a case-insensitive substring; results carry file:line.

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": {
      "operation": "<operation>"
    },
    "name": "graph_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNoneighbors: hops (1-6). subclasses/superclasses: levels (1-10).
limitNoMax edges.
top_nNooverview / surprising_connections: items to return.
sourceNoSource name. Omit when only one source applies.
symbolNoSymbol the operation acts on (not needed by overview / status).
targetNoDestination symbol for shortest_path.
max_hopsNoshortest_path: max path length.
operationYesOne of the operations listed in the tool description.
relation_filterNoneighbors: calls | inherits | imports | imports_from | contains.
min_community_sizeNooverview: minimum community size.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.13.0
    • changedInput schema / properties / depth / description
      Previous value: -"neighbors: hops out (1-6)."New value: +"neighbors: hops (1-6). subclasses/superclasses: levels (1-10)."
  2. Changed12 schema fields changedv1.12.0
    • removedInput schema / properties / relation_filter / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / relation_filter / default
      Removed value: -null
    • addedInput schema / properties / relation_filter / type
      Added value: +"string"
    • removedInput schema / properties / source / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / source / default
      Removed value: -null
    • addedInput schema / properties / source / type
      Added value: +"string"
    • removedInput schema / properties / symbol / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / symbol / default
      Removed value: -null
    • addedInput schema / properties / symbol / type
      Added value: +"string"
    • removedInput schema / properties / target / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / target / default
      Removed value: -null
    • addedInput schema / properties / target / type
      Added value: +"string"
  3. Addedv1.9.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the safety profile is handled. The description adds two real behavioral facts beyond that: `symbol` is a case-insensitive substring match and results carry file:line. It does not explain what 'raw' implies about result volume, ordering, or truncation.

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?

Two sentences, no filler, with the scope statement and sibling exclusion front-loaded before the operation list. The operation enumeration is dense but every token is load-bearing; only the parenthetical audit clause reads as slightly compressed.

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 10-parameter, no-output-schema tool, the definition covers the operation set, symbol matching, and output format, which is what an agent most needs. Remaining gaps are minor: result ordering and whether `limit` truncates silently are not stated.

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 coverage is 100%, so the baseline is 3, but the description carries information the schema does not: the actual operation values (the schema just says 'one of the operations listed in the tool description') and the substring matching rule for `symbol`, plus the audit/SOLID special case. That is meaningful added meaning over the schema.

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?

Names the resource (code knowledge graph), the edge types it exposes (calls, inheritance, imports), and enumerates all eleven operations, so an agent knows exactly what surface it reaches. It also explicitly positions itself against find_usages, impact and describe_symbol, making it distinguishable from siblings.

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?

The phrase 'for what find_usages, impact and describe_symbol do not cover' gives an explicit fallback condition and names the alternatives. It stops short of saying which operation to pick for which question, or when to prefer a sibling over this tool for a covered case.

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