Skip to main content
Glama

memory_search

Read-onlyIdempotent

Search memory notes by keywords using BM25 ranking, optional label/zone filters, and synonym expansion to return ranked snippets for recall.

Instructions

Search memory notes (BM25 + usage decay + zone priority).

Matching is lexical. The optional synonyms / keywords / related / note_line widen the query at search time: their terms score lower than the query's own words (synonyms and keywords 0.75, related and note_line 0.4), so an exact match still ranks first. Fill them when the note may use other words than the question; nothing is stored.

An optional labels list (AND) restricts hits to notes carrying every label before ranking; an empty or omitted list never changes scores or ordering. Returned hits carry the notes' stored labels.

Returns ranked hits with a snippet around the matched terms. Searching does not count as using a note; memory_get_note does.

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
zoneNorestrict to one zone ('inbox' = vault root)
limitNo
queryYeskeywords (any language)
labelsNoonly notes carrying every 'namespace:value' label (AND); '[]' or omitted = no filter
relatedNo4-8 looser terms a note answering the question might contain (broader, narrower or associated)
keywordsNo4-8 keywords for the topic in the user's other working language(s), e.g. English for a Korean query
synonymsNo4-8 close synonyms or other wordings of the query's key words, in the query's language; not words already in it
note_lineNoone short sentence written like a line of a note that would answer the question
include_archiveNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses that matching is lexical only, that widened terms are down-weighted (0.75 for synonyms/keywords, 0.4 for related/note_line) so exact matches rank first, that nothing is stored by filling them, and that hits carry stored labels plus a snippet around matched terms. The note that searching does not count as 'using' a note is a non-obvious side effect that annotations cannot convey.

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-loads the verb, resource, and ranking model, then layers widening fields, labels filtering, and return shape in a logical order. Dense parenthetical weight values are justified by the ranking behavior they explain, though the synonym/keyword/related/note_line cluster is restated in both prose and schema and could be marginally tighter.

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?

For a 9-parameter search tool with an output schema, this covers the important ground: lexical matching, weighting tradeoffs, filter semantics, and return shape. The main residual gap is include_archive, which is neither described here nor in the schema, so an agent must guess whether archived notes are searched by default.

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 78%, so the baseline is 3, but the description adds genuine meaning by explaining the relative scoring weight of each widening parameter and clarifying that labels are applied as a pre-ranking AND filter with no effect when empty. Only include_archive and limit go unexplained (limit is self-evident; include_archive is undocumented in both schema and description).

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 memory notes") and immediately discloses the ranking mechanism (BM25 + usage decay + zone priority), which differentiates it from semantic/related-note siblings. The closing line explicitly contrasts it with memory_get_note, so an agent can tell the two apart without opening a schema.

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?

Gives concrete guidance on when to populate the optional widening fields ("Fill them when the note may use other words than the question") and when to use the labels filter (AND semantics, empty list is a no-op). It also clarifies the read-vs-use distinction against memory_get_note, though it does not state when to prefer memory_related or memory_list over this tool.

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