参考MCP 工具recall

Tool Reference

recall

当 agent 需要聚焦答案时,检索相关的持久 context。recall 默认搜索你的全部 memory;在完整的 MCP 工具面上,传入 bucket 即可只搜索该 bucket。

区分空结果与失败

空结果是有效的 no-match 答案。凭据缺失或权限不足时,则会返回 401 或 403。

recall({ query: "a topic that was never saved", limit: 3 })
// -> empty result set, HTTP 200

公开 MCP 工具

recall

用途

执行轻量、宽容的 best-effort lookup,在回答前返回少量最相关的已保存 memory。

适用场景

  • 需要快速、未指定 scope 的答案,并且可以接受弱但有用的相关性。
  • 调用者希望得到少量排序后的 memory,而不是适合 prompt 大小的 context pack。
  • task 开始检查需要近期 working context,但不需要严格的 project/team filter。

不适用场景

  • 当弱匹配不能被当作答案呈现时不要使用;严格匹配请使用 search_memory。
  • 不要用它组装多个有界 memory 进行 prompt injection;请使用 recall_context。
  • 不要用它写入、更新或删除 memory。
  • REST API 接受的 field set 比 public MCP tool 更宽;scope、bucket、team 和 provenance filter 见 /docs/api/memory。

所需权限范围

  • 需要 memory:read;返回的 memory 仍受经过认证的 owner/team scope 限制。

参数列表

参数名类型描述
querystring · 必填要 recall 的自然语言问题或主题。
limitinteger · 默认值: 5保持有界、用于快速 lookup 的少量结果数。

返回模式

包含每条 memory 的 reference、location、content 和可用 attribution boundary 的排序文本响应。空结果是有效的 no-match 响应,不是 authorization signal。

使用示例

快速 best-effort recall
recall({
  query: "current MCP authentication decision",
  limit: 3
})

错误信息

  • 401/403:请求没有有效 bearer token 或缺少 memory:read。
  • Validation failure:query、limit 或 filter syntax 无效。
  • Scope or team mismatch:请求的 boundary 对经过认证的 owner 不可见。
  • search_memory — 使用 project/team filter 执行严格的 targeted matching。
  • recall_context — 使用有界的 multi-memory context pack。
  • remember — 保存明确需要持久化的 fact 或 decision。

来源: MCP 工具界面