Skip to main content

Module tools

Module tools 

Source
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_id
  • memory_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?) -> Vec
  • memory_forget(palace, drawer_id) -> ()
  • palace_create(name, description?) -> PalaceId
  • palace_list() -> Vec
  • palace_info(palace) -> palace metadata + stats
  • kg_assert(palace, subject, predicate, object, confidence?, provenance?) -> ()
  • kg_query(palace, subject) -> Vec

Structs§

MemoryMcpServer
Marker server type. Reserved for future stateful MCP server impls.

Functions§

dispatch_tool
Dispatch a tool call by name to its real handler.
tool_definitions
MCP tools/list response payload.
tool_definitions_with
Variant of tool_definitions aware of whether a default palace is configured. When has_default is true, the palace argument is moved out of the required list for every tool that takes it.