Skip to main content
Glama

recall

Read-onlyIdempotent

Search past decisions and preferences by semantic similarity, or refine low-confidence results to retrieve the correct memory.

Instructions

Search memories by semantic similarity, or refine low-confidence results.

MODES:

  • Search (default): recall("project architecture decisions")

  • Refine: recall("PostgreSQL vs MySQL decision", refine_from="database choice", refine_exclude=["rid1"])

ORDER: "recency" | "first_mention" (alias "chronological") | "certainty". Re-sorts the top_k already found; hints omitted. (Relevance feedback moved to memory(action="feedback") in v0.10 — recall is now purely read-only.)

WHEN TO USE: conversation start (summarize the user's first message); when the user references past decisions, people, preferences, or "last time"; when unsure about something the user assumes you know. Refine when first confidence < 0.5. After USING a recalled memory, reinforce it via memory(action="feedback", rid=..., feedback="relevant"). For "what is the CURRENT/latest X", prefer memory(action="chain_head") — similarity favors the most-similar revision, not the newest. For "what happened , in what order" ("tonight", "this week") use temporal(action="range") or since/until here — those words name the time frame, not the content; bare similarity cannot see the window.

QUERY: one short natural-language sentence (5-10 words), NOT a keyword list — keyword stuffing degrades quality. One focused question per call; separate calls for separate topics.

TRUST SIGNALS: each hit's why_retrieved may carry staleness warnings ("aged", "rarely confirmed", "superseded by a newer record"). Treat flagged hits as weak evidence — prefer fresher results or chain_head, and note the flag if you act on one anyway.

Args: query: Short natural language sentence (5-10 words). NOT a keyword list. top_k: Max results (default 10). 3-5 for focused, 10-20 for broad. memory_type: Filter: "semantic", "episodic", "procedural". domain: Filter: "work", "preference", "architecture", "people", etc. source: Filter: "user", "inference", "document", "system". namespace: Filter by namespace. include_consolidated: Include merged memories. include_superseded: v0.10 — recall EXCLUDES superseded records by default (current-by-default). Set True only for history / archaeology over a revision chain. expand_entities: Use knowledge graph boosting (default True). min_score_ratio: Drop hits scoring below this fraction of the TOP hit (0.8 = keep only near-as-good matches). Semantic search always returns top_k, even when one result is relevant and the rest are noise; this trims the tail instead of making you judge it. since: Only memories from this instant on — "2026-08-01", "2026-08-01T14:30:00Z", "6h"/"7d" (ago), or unix seconds. Filters BEFORE ranking: top_k is chosen inside the window. until: Window end (same formats; default now). Alone = up to then. refine_from: Original query text to refine from. query becomes the refinement. refine_exclude: Memory IDs to exclude when refining.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderNo
queryYes
sinceNo
top_kNo
untilNo
domainNo
sourceNo
namespaceNo
memory_typeNo
refine_fromNo
refine_excludeNo
expand_entitiesNo
min_score_ratioNo
include_supersededNo
include_consolidatedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.19.5
    • addedInput schema / properties / order
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Order"
      +}
  2. Changed2 schema fields changedv0.19.2
    • addedInput schema / properties / since
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Since"
      +}
    • addedInput schema / properties / until
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Until"
      +}
  3. Changed1 schema field changedv0.14.0
    • addedInput schema / properties / min_score_ratio
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Min Score Ratio"
      +}
  4. Changed5 schema fields changedv0.10.0
    • removedInput schema / properties / feedback
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Feedback"
      -}
    • removedInput schema / properties / feedback_rank
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "integer"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Feedback Rank"
      -}
    • removedInput schema / properties / feedback_rid
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Feedback Rid"
      -}
    • removedInput schema / properties / feedback_score
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Feedback Score"
      -}
    • addedInput schema / properties / include_superseded
      Added value: +{
      +  "default": false,
      +  "title": "Include Superseded",
      +  "type": "boolean"
      +}
  5. First observedv0.9.0

TDQS

A5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds meaningful behavior: recall excludes superseded records by default, semantic search always returns top_k, since/until filter before ranking, and hits may carry staleness warnings. It explicitly notes the read-only refactor and the order parameter's role as a re-sort, enriching the annotation profile without contradicting it.

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?

Long but densely organized under clear headings (MODES, ORDER, WHEN TO USE, QUERY, TRUST SIGNALS, Args). Every section adds operational value and nothing is redundant with the schema; the structure lets an agent fast-path to the relevant section.

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 15-parameter tool with complex behavior, the description is complete: it explains modes, ordering, when to use alternatives, query quality, trust/staleness signals, and every parameter's meaning. The output schema exists, so return-value detail is not required, and the tool's only required param is fully specified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and succeeds: the Args section documents all 15 parameters with formats, defaults, and behavioral nuance (e.g., min_score_ratio trims the tail, include_superseded for archaeology, since/until accepted formats). The query guidance ('5-10 words, not a keyword list') is especially valuable.

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 opens with a specific verb and resource: 'Search memories by semantic similarity, or refine low-confidence results.' It clearly distinguishes the tool's two modes and contrasts it with sibling tools like memory(action='chain_head') and temporal(action='range'), leaving no ambiguity about what recall does.

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?

A dedicated 'WHEN TO USE' section gives explicit triggers (conversation start, references to past decisions, low confidence) and names alternatives with conditions: prefer memory(action='chain_head') for current/latest and temporal(action='range') for time-window questions. It even instructs to reinforce recalled memories via memory(action='feedback').

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