Skip to main content
Glama

memory_search

Read-onlyIdempotent

Search persistent memory to retrieve relevant facts for a given agent, or query shared to get user-level preferences for personalized context.

Instructions

Search GrayMatter memory for relevant facts. Call once for your agent_id, then again with agent_id "shared" for user-level preferences.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural-language query to match against stored facts.
top_kNoMaximum number of facts to return (default: 8).
agent_idYesThe agent whose memory to search.
Behavior4/5

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

Annotations already establish that the tool is read-only, idempotent, and non-destructive, so the bar is lower. The description adds meaningful behavioral context by revealing the two-call pattern and the existence of a shared memory namespace, which the agent would not know from annotations alone.

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?

Two sentences deliver the core purpose and the critical usage pattern with no filler. The primary verb and resource are front-loaded, and every clause contributes useful information.

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 simple, read-only search tool, the description combined with the well-documented schema and safety annotations covers everything an agent needs to call it correctly. The only notable behavior — the two-call pattern — is explicitly included.

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. The description goes beyond the schema by specifying the exact agent_id values to use ('your agent_id' and '__shared__') and clarifying that queries are natural-language matches for stored facts, adding real semantic value.

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 ('Search') and resource ('GrayMatter memory') with a clear scope ('relevant facts'). It is readily distinguishable from sibling memory tools like memory_add and memory_reflect.

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?

The description gives explicit, actionable usage instructions: call once for the current agent_id, then again with agent_id '__shared__' for user-level preferences. This tells the agent exactly how to invoke the tool effectively.

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/angelnicolasc/graymatter'

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