Skip to main content
Glama

Search memory by meaning (where enabled)

search_memory
Read-onlyIdempotent

Searches notes by meaning when memory_status reports semantic: true; else it returns no hits and says why (semantic-unavailable or semantic-rebuilding), so use search_text or get_context. rankedBy "session_date" (the default) is newest first, so hits[0] is the latest, not necessarily the best; "score" is best match first. Judge hits by score (higher is closer), not position. A conversation's hits on one date are one hit, opening with its date (its header alone is no hit); a time phrase in it is resolved below, counted from that session. A hit without session_date comes last; a fact's hit has no notePath. There is no evidence object when this deployment has no evidence model configured and the pass is not switched off: no second pass runs, and the hits are the whole result. When there is one, its items come first, outside rankedBy, with reason "evidence", and its state is "ok", "off", "not-applied" or "failed". Facts saved with remember are added outside rankedBy, within top_k; a writerConflict line on one means it replaced another agent's value. index.stale: the semantic index lags saved facts. A "replaced" hit's correction is listed before it (by: its id, source: who saved it). A relevance object says whether anything on file closely matches the query: relevant is true only when the closest match is among the hits, and when it is false the hits are only the nearest ones, so do not present them as an answer unless one clearly answers it. When relevant is true and the closest match is a remembered fact that top_k left no room to list, relevance.fact names it (subject, predicate, object, scope); you can answer from it, and the hits are still at most top_k in all.

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

Input Schema

NameRequiredDescriptionDefault
queryYesNatural language query
scopeNoMemory scope: "global" (default) or scope:<slug> / project:<slug>
sinceNoOnly hits dated on or after this ISO date or date-time
top_kNoMax matches (default 50), not counting the short statements the session expansion adds to them
untilNoOnly hits dated on or before this ISO date or date-time
explainNoSet true to add an `explain` object to the reply: the lanes used, candidate counts after each stage, and up to 5 dropped ids with a reason (budget, reply-budget, per-note-cap, floor, scope, retired). No note text.
include_historyNoAlso return superseded (corrected) memory events, labelled as historical. Default false: only current memory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / since
      Added value: +{
      +  "description": "Only hits dated on or after this ISO date or date-time",
      +  "maxLength": 40,
      +  "type": "string"
      +}
    • addedInput schema / properties / until
      Added value: +{
      +  "description": "Only hits dated on or before this ISO date or date-time",
      +  "maxLength": 40,
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / explain / description
      Previous value: -"Set true to add an `explain` object to the reply: the lanes used, candidate counts after each stage, and up to 5 dropped ids with a reason (budget, per-note-cap, floor, scope, retired). No note text."New value: +"Set true to add an `explain` object to the reply: the lanes used, candidate counts after each stage, and up to 5 dropped ids with a reason (budget, reply-budget, per-note-cap, floor, scope, retired). No note text."
  3. Changed1 schema field changed
    • addedInput schema / properties / explain
      Added value: +{
      +  "description": "Set true to add an `explain` object to the reply: the lanes used, candidate counts after each stage, and up to 5 dropped ids with a reason (budget, per-note-cap, floor, scope, retired). No note text.",
      +  "type": "boolean"
      +}
  4. Changed1 schema field changed
    • changedInput schema / properties / top_k / description
      Previous value: -"Max matches (default 20), not counting the short statements the session expansion adds to them"New value: +"Max matches (default 50), not counting the short statements the session expansion adds to them"
  5. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only cover safety (readOnly, idempotent, non-destructive), and the description goes well beyond them: reason codes for empty results, index.stale lag, evidence-pass states, fact injection outside rankedBy, and the relevance object's true/false semantics. The density is high but the disclosure of non-obvious output behavior is genuinely useful.

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

Conciseness3/5

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

The purpose and the fallback route are front-loaded, which is good. What follows is a single dense run-on covering ranking, session expansion, fact injection, evidence passes and relevance in semicolon-chained clauses with no enumeration, making it harder to parse than its content warrants.

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?

There is no output schema, and the description compensates by explaining the hit ordering, the meaning of score vs. position, the relevance object, and the edge cases (missing session_date, absent notePath, missing evidence object). For a 7-parameter search tool this covers what an agent needs to call it and read the result correctly.

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 query, scope, since, until, top_k, explain and include_history are already documented. The description adds some meaning to top_k (session-expansion statements and injected facts do not consume it) but mostly describes result-shaping rather than input semantics, so the baseline of 3 applies.

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 ('Searches notes by meaning') plus the enabling condition tied to memory_status. It explicitly names the fallback siblings (search_text, get_context) so an agent can distinguish this tool without opening any 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 an explicit when-not condition (semantic unavailable or rebuilding → no hits, so use search_text or get_context) and explains how to interpret results before presenting them as answers. It never states the positive case for choosing semantic search over search_text on a working deployment, which keeps it short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.