Skip to main content
Glama

search_memories

Search saved memories in a workspace to locate context you don't know the file for. Uses ranked full-text search when available, with a deterministic grep fallback for pattern matching.

Instructions

Search saved memories for a workspace.

When the FTS5 memory index is available and fresh, returns ranked hits (by relevance, with a bonus for user-authored memories) annotated source=memory-fts. Otherwise falls back to a deterministic grep over the markdown files, returning each match with the memory name and line. Smart-case (case-insensitive if 'pattern' is all lowercase) unless 'case_sensitive' is set; 'use_regex' forces the grep path. 'mode' (auto|fts|grep) overrides the choice; default auto.

Memory-only corpus with a deterministic grep fallback — for ranked discovery across code, docs, AND memories in one call, use workspace_search instead. Useful when you don't know which memory contains a piece of context — much faster than reading every memory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoSearch strategy. auto (default): ranked FTS when the index is fresh, falling back to grep when the index is stale OR FTS finds no hits (FTS matches whole tokens, grep matches substrings). fts: force ranked FTS (reindex if stale; keeps an empty result). grep: force literal/regex grep.
patternNoText or regex pattern to search for.
use_regexNoTreat pattern as a regex. Forces the grep path (FTS is not regex).
workspaceNoAbsolute workspace path. Defaults to the daemon's resolved workspace.
case_sensitiveNoDefault: smart-case. Setting this forces the grep path (FTS is case-insensitive).
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains the FTS5 vs. grep fallback logic, the ranking bonus for user-authored memories, the 'source=memory-fts' annotation, smart-case behavior, and the effect of 'use_regex' and 'case_sensitive' forcing the grep path. It also reveals the output format for grep ('memory name and line'), making behavior highly 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 longer than a simple one-liner but every sentence adds value, covering the main purpose, fallback mechanics, parameter nuances, and alternative tool guidance. There is minor redundancy (e.g., mentioning 'deterministic grep fallback' twice) and the final 'use workspace_search' sentence could be viewed as slightly repetitive, but overall it is well-structured and information-dense without being overly verbose.

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?

Despite lacking an output schema, the description adequately covers return values: ranked hits with source annotation for FTS, and memory name+line for grep. It also explains the behavioral nuances of each mode, the conditions for fallback, and the difference from the broader workspace_search tool. For a search tool of this complexity, the description is remarkably complete.

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?

The schema covers 100% of parameters with detailed descriptions, so the baseline is 3. The description adds extra context beyond the schema by explaining how 'mode' overrides the default choice, why 'use_regex' and 'case_sensitive' force grep, and what the FTS vs. grep distinction means for results. It also clarifies that FTS matches whole tokens while grep matches substrings, which enriches parameter understanding.

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 first sentence clearly states the tool's function: 'Search saved memories for a workspace.' It distinguishes itself from sibling tools like workspace_search by emphasizing that it targets the memory-only corpus, and it also differentiates the FTS vs. grep fallback behavior, making its scope explicit.

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 explicitly tells the agent when to use this tool vs. alternatives: 'for ranked discovery across code, docs, AND memories in one call, use workspace_search instead.' It also notes that this tool is 'useful when you don't know which memory contains a piece of context' and is 'much faster than reading every memory.' This provides clear when-to-use and when-not-to-use guidance.

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/plumbkit/plumb'

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