Expand description
MCP tool surface for trusty-memory.
Why: Concentrates the public tool contract in one file so changes are
auditable and the MCP schema stays in sync with the implementation.
What: Defines MemoryMcpServer, tool_definitions() (the MCP
tools/list payload), and the in-process tool dispatcher wired to the
real PalaceRegistry + retrieval / KG APIs.
Test: cargo test -p trusty-memory-mcp validates the schema and dispatch.
Tools exposed:
memory_remember(palace, text, room?, tags?)-> drawer_idmemory_recall(palace, query, top_k?)-> Vec(L0+L1+L2) memory_recall_deep(palace, query, top_k?)-> Vec(L3 deep) memory_list(palace, room?, tag?, limit?)-> Vecmemory_forget(palace, drawer_id)-> ()palace_create(name, description?)-> PalaceIdpalace_list()-> Vecpalace_info(palace)-> palace metadata + statskg_assert(palace, subject, predicate, object, confidence?, provenance?)-> ()kg_query(palace, subject)-> Vec
Structs§
- Bm25
Index Request - One pending BM25 index op enqueued by
memory_remember/memory_notefor the per-AppStateindexer worker to drain (issue #231). - Memory
McpServer - Marker server type. Reserved for future stateful MCP server impls.
Constants§
- BM25_
INDEX_ QUEUE_ CAPACITY - Bounded-queue capacity for the BM25 index worker (issue #231).
Functions§
- dispatch_
tool - Dispatch a tool call by name to its real handler.
- spawn_
bm25_ index_ worker - Spawn the single long-lived BM25 indexer worker that drains
bm25_index_rxand forwards each request to the daemon (issue #231). - tool_
definitions - MCP
tools/listresponse payload. - tool_
definitions_ with - Variant of
tool_definitionsaware of whether a default palace is configured. Whenhas_defaultis true, thepalaceargument is moved out of therequiredlist for every tool that takes it.