Skip to main content
Glama

memory_query

Read-only

Retrieve a focused subgraph from memory to answer questions without flooding context. Uses hybrid search and graph traversal, with configurable depth and token budget.

Instructions

Answer a question with a TIGHT, relevant subgraph instead of flooding context. Seeds from hybrid search, walks the memory graph (hub-avoiding) up to max_hops, and returns a token-budgeted "context" string plus structured nodes — with an actionable hint when truncated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe question to answer. Seeds from hybrid search, then walks the memory graph to return a tight, relevant subgraph instead of flooding context.
max_tokensNoApproximate token budget for the rendered context (~4 chars per token). Nodes are rendered until the budget is hit, then truncated with a hint.
max_hopsNoHow many hops to walk out from the seed memories (1-4).
seed_limitNoMaximum seed memories from the initial search. A gap cutoff drops seeds scoring below 20% of the top seed to keep the traversal focused.
scopeNoMemory scope for isolation
namespaceNoNamespace within scope (e.g., project name, team name)
Behavior4/5

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

Annotations already mark the tool as read-only (readOnlyHint: true). The description adds substantial behavioral context: hybrid search seeding, hub-avoiding graph walk, token budget, truncation with actionable hint. No contradiction observed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, dense sentence that packs all key information: purpose, mechanism, and return format. No wasted words, front-loaded with the core verb. Every phrase earns its place.

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 (graph walk, token budget, truncation) and absence of output schema, the description covers the main aspects: seeds from hybrid search, hub avoidance, max_hops, token budget, and return of 'context string plus structured nodes' with truncation hint. Slightly vague on the exact structure of nodes, but overall 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 description coverage is 100%, so the schema already explains each parameter thoroughly. The description only briefly mentions max_hops and token-budgeted, adding little extra meaning beyond the schema's existing descriptions.

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 answers a question with a tight, relevant subgraph from memory, explicitly distinguishing it from flood-fetch alternatives. It mentions hybrid search, graph walking, and token budgeting, which differentiates it from siblings like memory_query_structured or simple memory_search.

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

Usage Guidelines3/5

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

The description implies usage for concise memory queries but does not explicitly state when to use this tool over alternatives like memory_query_structured or when not to use it. No exclusions or comparisons to siblings are provided.

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/YonasValentin/mcp-memory-graph'

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