Skip to main content
Glama

query_graph

Read-onlyIdempotent

Explore graph topology, trace upstream/downstream dependencies, run read-only SQL, and retrieve compact task slices to answer relationship queries without aggregated metrics.

Instructions

Query graph topology, neighborhoods, dependency paths, safe read-only SQL queries, and compact System One task slices (actions: subgraph, trace, raw, natural_language, compact_slice). Use query_graph instead of get_analytics when exploring graph topology and path traversals rather than aggregated numerical metrics.

Returns subgraph nodes and edges, upstream/downstream trace path, raw SQL rows, or compact task slice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlNoRead-only SELECT query for raw action.
depthNoMaximum depth for subgraph query (1-10).
queryNoNatural language search query for natural_language action.
actionYesThe graph query action to execute: subgraph, trace, raw, natural_language, compact_slice.
paramsNoQuery parameters for raw action.
node_idNoStarting node ID for trace.
projectNoTarget project name or slug.
root_idNoRoot node ID for subgraph query.
directionNoDirection of dependency traversal for trace.
max_depthNoMaximum traversal depth for trace (1-50).
edge_typesNoAllowed edge types for trace (default: depends_on, blocks, child_of).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.3.1
    • changedInput schema / properties / action / description
      Previous value: -"The graph query action to execute."New value: +"The graph query action to execute: subgraph, trace, raw, natural_language, compact_slice."
    • addedInput schema / properties / action / enum
      Added value: +[
      +  "subgraph",
      +  "trace",
      +  "raw",
      +  "natural_language",
      +  "compact_slice"
      +]
  2. Changed3 schema fields changedv1.2.1
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -true
    • addedInput schema / required
      Added value: +[
      +  "action"
      +]
  3. Changed13 schema fields changedv1.0.0
    • changedInput schema / additionalProperties
      Previous value: -falseNew value: +true
    • addedInput schema / properties / action
      Added value: +{
      +  "description": "The graph query action to execute.",
      +  "type": "string"
      +}
    • addedInput schema / properties / depth
      Added value: +{
      +  "description": "Maximum depth for subgraph query (1-10).",
      +  "type": "number"
      +}
    • addedInput schema / properties / direction
      Added value: +{
      +  "description": "Direction of dependency traversal for trace.",
      +  "enum": [
      +    "upstream",
      +    "downstream"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / edge_types
      Added value: +{
      +  "description": "Allowed edge types for trace (default: depends_on, blocks, child_of).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / max_depth
      Added value: +{
      +  "description": "Maximum traversal depth for trace (1-50).",
      +  "type": "number"
      +}
    • addedInput schema / properties / node_id
      Added value: +{
      +  "description": "Starting node ID for trace.",
      +  "type": "string"
      +}
    • changedInput schema / properties / params / description
      Previous value: -"Optional query parameter values."New value: +"Query parameters for raw action."
    • changedInput schema / properties / project / description
      Previous value: -"Optional project identifier."New value: +"Target project name or slug."
    • addedInput schema / properties / query
      Added value: +{
      +  "description": "Natural language search query for natural_language action.",
      +  "type": "string"
      +}
    • addedInput schema / properties / root_id
      Added value: +{
      +  "description": "Root node ID for subgraph query.",
      +  "type": "string"
      +}
    • changedInput schema / properties / sql / description
      Previous value: -"The SELECT SQL query string."New value: +"Read-only SELECT query for raw action."
    • removedInput schema / required
      Removed value: -[
      -  "sql"
      -]
  4. First observedv0.9.1

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered. The description reinforces 'safe read-only SQL,' which the schema already states, and adds only brief return-shape notes per action without disclosing permissions, limits, or scoping behavior.

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?

Three sentences that are front-loaded with the tool's scope and routing rule. The parenthetical action list duplicates the enum already present in the schema, a minor redundancy, but nothing is bloated.

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 an 11-parameter, multi-action tool with no output schema, the description does summarize the return shapes across actions and gives a routing rule. It falls short on mapping parameters to actions, but the schema covers parameters and the safety profile is fully annotated, making the definition largely sufficient.

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 coverage is 100%, so all 11 parameters are already documented in the schema, which serves as the baseline 3. The description names the actions but adds no parameter-level detail (e.g., which params apply to which action) beyond what the schema provides.

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?

States a specific verb (Query) plus the resources it operates on (graph topology, neighborhoods, dependency paths, compact task slices) and enumerates its five actions. It explicitly distinguishes itself from the get_analytics sibling, so an agent can route without opening the schema.

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 description gives an explicit when-to-use/when-not rule: use query_graph for topology and path traversals rather than aggregated metrics, naming get_analytics as the alternative. It does not, however, guide selection among its own five actions (subgraph vs trace vs natural_language), leaving that to inference.

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