Skip to main content
Glama

query_graph

Answer a question over one workspace's knowledge graph with local hybrid retrieval: vector similarity, keyword match and graph neighbourhoods are combined, the strongest passages and their entities are selected, and the answer is composed from them with source evidence. Use it for questions a handful of documents can answer; use query_graph_global for corpus-wide synthesis. It reads the latest published snapshot only, so results are stable until a new build publishes. Returns: an answer plus the evidence snippets behind it, each with the source document and chunk it came from.

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": {
      "query": "<query>"
    },
    "name": "query_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe natural-language question or claim to check against the corpus (max 4000 characters).
max_resultsNoHow many evidence passages to retrieve and consider, 1–20 (default 5). Raise it for broad questions, lower it when you want a tight, cheap answer.
workspace_idNoWorkspace that owns the graph, 1–63 chars of [a-z0-9-]. Use the same id for every operation on one corpus. Defaults to "default".default
community_levelNoRestrict retrieval to one community level of the graph hierarchy: 0 is the coarsest, higher integers are finer. Omit to search across levels.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / community_level / description
      Added value: +"Restrict retrieval to one community level of the graph hierarchy: 0 is the coarsest, higher integers are finer. Omit to search across levels."
    • addedInput schema / properties / max_results / description
      Added value: +"How many evidence passages to retrieve and consider, 1–20 (default 5). Raise it for broad questions, lower it when you want a tight, cheap answer."
    • addedInput schema / properties / query / description
      Added value: +"The natural-language question or claim to check against the corpus (max 4000 characters)."
    • addedInput schema / properties / workspace_id / description
      Added value: +"Workspace that owns the graph, 1–63 chars of [a-z0-9-]. Use the same id for every operation on one corpus. Defaults to \"default\"."
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the hybrid retrieval pipeline, the snapshot-stability property ('results are stable until a new build publishes'), and the evidence-bearing return format. It does not state permissions or latency/cost characteristics, but the read-only nature is clear from 'reads the latest published snapshot'.

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?

Front-loads the core purpose and method, then the routing rule, then stability and return shape. Dense but every sentence conveys useful information; the retrieval-mechanism clause is slightly long but justified for setting expectations on result quality.

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 RAG query tool with no annotations and no output schema, the description supplies exactly what's needed: selection guidance against the sibling, the snapshot-stability caveat, and an explicit statement of what is returned (answer plus evidence snippets with source document and chunk). Nothing an agent needs in order to call it correctly is missing.

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 the parameters (query, max_results, workspace_id, community_level) are already fully documented in the schema. The description adds meaning about the retrieval pipeline but gives no parameter-level guidance of its own, which matches the baseline 3 for a fully-covered 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?

The description names a specific verb and resource ('Answer a question over one workspace's knowledge graph') and explains the retrieval method (vector, keyword, graph neighbourhoods) plus the output shape. It explicitly contrasts with the sibling query_graph_global, so an agent can distinguish the two without opening either schema.

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?

It gives an explicit when-to-use ('questions a handful of documents can answer') paired with the named alternative and its condition ('use query_graph_global for corpus-wide synthesis'). Nothing is left to inference about tool selection.

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