Skip to main content
Glama

memory_search

Read-only

Search persistent project and personal memory by keyword to retrieve past decisions, conventions, and preferences. Use it before asking users about context they may have already provided.

Instructions

Search persistent memory by keyword (BM25 full-text). Returns matching memories from the current project and/or personal scope. Call before asking the user about past decisions, conventions, or preferences they may have told you before. Search well: break the question into its concepts and try 2–3 phrasings per concept — synonyms, the user's other language, shorter keyword forms — and check the other scope too, before concluding nothing is stored. Results are ranked by BM25 within review tiers — reviewed (approved/published) project memories come first. limit caps how many come back (default 8) and type restricts to one memory type.

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": "memory_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNoRestrict to memories of this type. Closed taxonomy — a misspelled type is rejected, never silently empty.
limitNoMax results to return (default 8).
queryYesFree-text query. File paths, error strings, identifiers work well.
scopeNoWhich scope(s) to search. Default: both.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.2
    • changedInput schema / properties / type / description
      Previous value: -"Restrict to memories of this type (e.g. decision, preference, gotcha)."New value: +"Restrict to memories of this type. Closed taxonomy — a misspelled type is rejected, never silently empty."
    • addedInput schema / properties / type / enum
      Added value: +[
      +  "fact",
      +  "preference",
      +  "decision",
      +  "constraint",
      +  "todo",
      +  "knowledge",
      +  "howto",
      +  "gotcha",
      +  "lesson",
      +  "observation",
      +  "reference"
      +]
  2. Changed3 schema fields changedv0.7.3
    • addedInput schema / properties / limit / description
      Added value: +"Max results to return (default 8)."
    • changedInput schema / properties / scope / enum
      Previous value: -[
      -  "project",
      -  "personal",
      -  "user",
      -  "both"
      -]New value: +[
      +  "project",
      +  "personal",
      +  "both"
      +]
    • changedInput schema / properties / type / description
      Previous value: -"Restrict to memories of this type."New value: +"Restrict to memories of this type (e.g. decision, preference, gotcha)."
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With readOnlyHint=true and openWorldHint=false already covering the safety profile, the description adds genuinely useful behavioral detail: results are ranked by BM25 within review tiers, reviewed (approved/published) project memories come first, and default limit is 8. It does not describe the shape of individual returned memories, but the ranking and tiering context is the important disclosure for interpreting result order.

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-loaded with purpose, then usage trigger, then search strategy, then result behavior. It is on the longer side, and the middle search-strategy sentence is dense, but every clause carries actionable guidance rather than filler.

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?

There is no output schema, and the description compensates by stating that matching memories are returned from project and/or personal scope and how they are ranked. It stops short of describing the fields of a returned memory, which is the one remaining gap for a retrieval tool.

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 schema already documents all four parameters including enums and the limit default. The description restates the limit default and the type restriction, and adds only slight extra meaning via 'check the other scope too.' Baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource ('Search persistent memory by keyword (BM25 full-text)') plus scope ('current project and/or personal scope'), which clearly distinguishes it from siblings like memory_list and memory_add. The mechanism (BM25 full-text) is named, so an agent knows exactly what kind of retrieval this is.

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?

Explicit when-to-use: 'Call before asking the user about past decisions, conventions, or preferences they may have told you before.' It also prescribes a strategy — break the question into concepts, try 2–3 phrasings, check the other scope before concluding nothing is stored — which goes well beyond a bare invocation hint.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.