Skip to main content
Glama

Search past memories semantically

search_memories
Read-only

Top-K semantic memory retrieval. Embeds the query via Cloudflare Workers AI (bge-small-en-v1.5, 384-dim) and asks the agents.search_memories RPC for the K closest rows by cosine distance. Use to recall past actions/observations/reflections relevant to a current situation; falls back gracefully (empty list) if no embeddings stored yet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
queryYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Describes the embedding process (Cloudflare Workers AI, bge-small-en-v1.5, 384-dim), RPC call with cosine distance, and graceful fallback. Annotations already declare readOnlyHint=true, so no contradiction; description adds useful implementation details beyond annotations.

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?

Two sentences front-load the core purpose and method. Every sentence adds value: first sentence defines operation and mechanism, second sentence gives usage context and fallback behavior. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema is provided, and the description only indirectly indicates return of 'rows' without specifying fields (e.g., content, score). For a retrieval tool, this leaves ambiguity about what the agent receives. However, for a search tool with low complexity, it is minimally adequate.

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 description coverage is 0%, so description must compensate. It mentions 'query' (text to embed) and 'K' (number of results, default 10) implicitly through 'Top-K' and 'asks for the K closest rows'. However, it does not explicitly explain constraints like maxLength or the min/max for k, which are in schema but lack descriptions.

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?

Clearly states 'Top-K semantic memory retrieval' with specific verb and resource (search memories via semantic embedding). Distinguishes itself from siblings like recall_nearby_memories and recent_memory by specifying semantic similarity rather than spatial or temporal retrieval.

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?

Explicitly says 'Use to recall past actions/observations/reflections relevant to a current situation' and notes graceful fallback (empty list). Does not explicitly name alternative tools or when not to use, but context implies when semantic recall is appropriate.

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.

Resources