recall
Search and retrieve relevant memories from the NeverOnce server, prioritizing corrections to ensure accurate information access.
Instructions
Search memories by relevance. Corrections surface first.
Args:
query: What to search for.
limit: Max results to return.
namespace: Filter by namespace.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No | ||
| namespace | No | default |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- neveronce/server.py:94-117 (handler)The 'recall' MCP tool definition and handler implementation. It uses the Memory store to fetch relevant memories and formats them for the user.
@mcp.tool() def recall(query: str, limit: int = 10, namespace: str = "default") -> str: """Search memories by relevance. Corrections surface first. Args: query: What to search for. limit: Max results to return. namespace: Filter by namespace. """ mem = _get_mem() results = mem.recall(query, limit=limit, namespace=namespace) if not results: return "No memories found." lines = [] for r in results: marker = " [CORRECTION]" if r["memory_type"] == "correction" else "" tags = json.loads(r["tags"]) if isinstance(r["tags"], str) else r["tags"] tag_str = f" ({', '.join(tags)})" if tags else "" lines.append( f"#{r['id']}{marker} [importance:{r['importance']}]{tag_str}\n" f" {r['content']}" ) return "\n\n".join(lines)