Skip to main content
Glama

query_graph

Search a knowledge graph to retrieve prior context, preferences, and decisions before answering questions. Returns related nodes and their connections.

Instructions

Automatically search the memory graph before answering questions that may depend on prior context, user preferences, project decisions, constraints, or earlier conversation state. Returns a serialized subgraph with matching nodes and their connected neighborhood. Uses hybrid retrieval (transcript + graph) by default for robust fallback. Understands temporal references such as 'recently', 'latest', 'originally', and 'last week'. Benchmark modes: use retrieval_mode='graph' for graph-only (no verbatim fallback), 'verbatim' for transcript-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
as_ofNoISO-8601 datetime. When provided, return only nodes valid at that point in time (overrides include_invalidated).
queryYesNatural-language search query.
projectNoOptional project or workspace name used to partition memory.
agent_idNoOptional agent or client identifier used to partition memory.
max_depthNoRelationship traversal depth around matching nodes.
max_nodesNoMaximum number of matching nodes to return.
session_idNoOptional conversation or run identifier used to partition memory.
expand_depthNoOptional support expansion depth. At 1, graph mode may return up to twice max_nodes.
retrieval_modeNoRetrieval strategy: graph-only, verbatim transcript retrieval, or hybrid fusion with reranking.hybrid
include_invalidatedNoWhen true, include nodes whose valid_to has passed. Default false excludes expired nodes.
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses that the tool returns a serialized subgraph, uses hybrid retrieval by default, understands temporal references, and describes benchmark modes. It does not cover permissions or side effects, but the behavioral traits are adequately transparent.

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 well-structured and front-loads the main purpose. It is somewhat lengthy but each sentence adds value. Minor redundancy in mode explanations could be tightened, but overall effective.

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?

Given the tool's complexity (10 parameters, no output schema), the description covers essential aspects: when to use, retrieval modes, temporal understanding. It omits details on return format or pagination, but it is sufficiently complete for an agent to understand usage.

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%, baseline is 3. The description adds value by explaining retrieval modes and the 'as_of' parameter's behavior (overrides include_invalidated), providing context beyond the schema. Other parameters are not elaborated, but the added context for key parameters justifies a 4.

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 the tool searches the memory graph for prior context, returns a serialized subgraph, and specifies the default hybrid retrieval. It distinguishes from siblings like 'aggregate_graph' and 'build_context' by focusing on automatic search and temporal understanding.

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 explicitly recommends use 'before answering questions that may depend on prior context' and explains when to use different retrieval modes (graph-only, verbatim, hybrid). It does not explicitly list alternatives or exclusions, but the context is clear.

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/Abhigyan-Shekhar/Waggle-mcp'

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