Skip to main content
Glama

search_memory

Search memories and knowledge using hybrid vector and BM25 retrieval, with optional project scoping and deterministic table Q&A.

Instructions

混合检索记忆与知识(向量语义 + BM25 关键词,归一化融合); 返回命中列表,每项含 id/content/score/type/source。 project 指定项目子库时,检索范围 = 该项目子库 + 全局库(项目命中加分); 不传 project 时只检索全局库。 table=true 时先尝试确定性表格问答:命中返回 {"table": true, "answer", "sources"}, 未命中回退普通检索;整个过程不需要 LLM。 top_k 小于 1 时返回 {"error": "INVALID_ARGUMENT", "message": 原因}。 client:来源客户端(可选,缺省从 clientInfo 自动识别,仅审计)。 English: Hybrid retrieval over memories and knowledge (vector semantics + BM25 keywords, normalized fusion); returns a hit list, each item having id/content/score/type/source. With project, the scope is that project's sub-store plus the global store (project hits boosted); without project, only the global store is searched. With table=true, try deterministic table Q&A first and return {"table": true, "answer", "sources"} on a hit; otherwise fall back to normal retrieval. No LLM is involved. Returns {"error": "INVALID_ARGUMENT", "message": reason} when top_k is less than 1. client: source client (optional; auto-detected from clientInfo when omitted; audit only).

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
queryYes
tableNo
top_kNo
clientNo
projectNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.0
    • addedInput schema / properties / table
      Added value: +{
      +  "default": false,
      +  "title": "Table",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full disclosure burden and does so well: it reveals the ranking mechanism, the scope/boosting rule tied to project, the deterministic no-LLM table path with its own return shape, and the exact error contract for top_k < 1. It omits whether the call is strictly read-only and says nothing about result limits or pagination beyond top_k.

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?

Content is front-loaded with the core operation first and edge-case contracts last, which is good structure. But the entire description is duplicated in Chinese and English, roughly doubling length with zero added information for a reader who can parse either, which is wasteful.

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 five-parameter hybrid retrieval tool with no annotations, the definition covers mechanism, scope rules, the table branch and its fallback, the error case, and audit-only client handling. An output schema exists, so the brief return-shape notes are supplementary rather than a gap-filling necessity.

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 description coverage is 0%, so the description must compensate, and it largely does: project (scope selection), table (deterministic Q&A path), top_k (invalid when < 1, returning INVALID_ARGUMENT), and client (optional, auto-detected from clientInfo, audit only) all get meaning the bare schema lacks. Only query itself is left undefined beyond the implied search semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific operation on a specific resource — hybrid (vector + BM25) retrieval over memories and knowledge — and spells out the fusion method and return item shape (id/content/score/type/source). It is unmistakably a search tool rather than read_memory or write_memory, but it never explicitly contrasts itself with the closest sibling, ask_kb, which also answers questions over the knowledge base.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives conditional behavior for two parameters (with project = project sub-store + global with boosting; without project = global only; table=true = try table Q&A then fall back), which implicitly tells an agent how to steer the call. However, there is no explicit when-to-use-this-vs-alternatives guidance — nothing says when to prefer search_memory over ask_kb or read_memory, or when table=true is the right first move.

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