palace
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
MANDATORY: Palace Memory Protocol (three hard triggers, every session, no exceptions):
PALACE IS THE ONLY PERSISTENT MEMORY: never write memories to a client's built-in memory files (for example Claude Code's ~/.claude/projects/*/memory/ and its MEMORY.md); file them in Palace. The user's stated preferences live in general/preferences; file new ones there via palace_remember(wing="general", room="preferences").
SESSION START: always, before anything else: → palace_status → palace_session_context(agent_name) → palace_diary_search (recent work in this project)
BEFORE ANSWERING: any question about past decisions, preferences, people, projects, or "what happened last time?": → palace_search + palace_kg_query. Never answer from training data alone. MEMORY-FIRST: call palace_search before grep/file-search for remembered decisions, fixes, conventions, session history. CODE-SEARCH-FIRST: use grep only for current symbols, exact definitions, or implementation details that may have changed. For preferences/conventions: also call palace_preference_search. When Palace answers, cite provenance (wing, room, source file, drawer id).
AFTER WORK: after any substantive task, fix, decision, or discovery: → palace_diary_write (what happened, what you learned, what matters) → palace_kg_add for stable facts; palace_kg_invalidate + palace_kg_add when facts change. To file a key fact: palace_remember (importance=5). To delete outdated info: palace_forget.
MEMORY ROUTING: use Palace for prior decisions, user preferences, previous fixes, commands that worked, project history, and "what happened last time?". Use KG for stable facts. Use diary for session continuity. Use code search first only for current source symbols, exact definitions, and implementation details that may have changed.
Skipping any trigger is a protocol violation. Storage is not memory, but storage + this protocol = memory.
NOTE FOR CLIENTS THAT DEFER MCP TOOLS (e.g. Claude Desktop/Cowork): the palace_* tools may need to be loaded via tool search before use. Load the protocol tools in ONE batch first: palace_status, palace_session_context, palace_diary_search, palace_project_status, palace_search, palace_kg_query, palace_preference_search, palace_diary_write, palace_kg_add.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| palace_statusB | Palace overview: total drawers, wing counts, and recent sessions. Pass verbose=true for room counts, the protocol text, and the AAAK spec. |
| palace_gainA | Report how much value Palace's MCP tools have delivered, from a local usage log: hits, estimated tokens saved, skipped duplicates, recall rate, latency, and per-project totals. Use it when the user asks whether Palace is paying off; for database or model health use palace_verify instead. Read-only by default. Three options change it: history=true returns raw recent events instead of the summary; record={...} stores feedback on one search hit (a write); reset=true permanently deletes usage events (for one project, or all projects when project is omitted), so only reset when the user asks. |
| palace_verifyA | Verify Palace MCP health: visible tools, database integrity, embedding status, and model cache. |
| palace_recall_checkA | Test whether known memories can actually be found. For each probe it runs the same hybrid search as palace_search and checks whether a drawer whose source_file equals expected_source appears in the top |
| palace_conflictsA | Find knowledge-graph facts that may be stale or contradictory: groups of facts with the same subject and predicate but different objects (for example two different values for 'project uses_database'). Each conflict lists the triples with their valid_from/valid_to dates and whether each is still current. Read-only. Use it to audit the graph; resolve a real conflict with palace_kg_invalidate on the outdated fact. For one entity's facts without conflict detection use palace_kg_query. |
| palace_list_wingsA | List all registered wings with their kind (project/topic), description, project path, last mined time, and drawer counts. |
| palace_project_statusA | Check whether the current project or topic is known to the palace. Returns a state (mined / registered_not_mined / unknown) plus a recommendation. Call this when entering a workspace; if it is unmined, ask the user before calling palace_mine, and offer palace_create_wing for non-repo topics. |
| palace_mineA | Mine (or re-sync) a CODE REPOSITORY directory into the palace (only after the user agrees). Repos only: chats or non-repo topics have no folder to mine, so use palace_create_wing for those. Accepting this implicitly initialises palace.yaml for first-time repos and then syncs files into the project's wing: new files are added, edited files are re-mined so their drawers reflect the latest content, unchanged files are left alone, and drawers for files deleted from disk are removed. The result's |
| palace_create_wingB | Declare a wing in the registry. Use kind='topic' for non-repo work (e.g. sales topics) so memories have a dedicated area, or kind='project' to pre-declare a repo wing. |
| palace_rename_wingA | Rename a wing, or merge it into another wing when the new name already exists (e.g. 'my-proj' into 'my_proj'). Moves every drawer, closet, tunnel and mined-file record; drawer ids stay the same. Cannot be undone. Use only when the user asks. |
| palace_list_roomsA | List rooms within a wing (or all rooms if no wing given) |
| palace_get_taxonomyB | Full taxonomy: wing → room → drawer count |
| palace_get_aaak_specA | Get the AAAK dialect specification: the compressed memory format Palace uses. |
| palace_searchB | Semantic search. Returns verbatim drawer content with similarity scores, plus the chunks right before and after each hit (source_context). |
| palace_check_duplicateB | Check if content already exists in the palace before filing |
| palace_add_drawerB | File verbatim content into the palace. Checks for duplicates first. |
| palace_delete_drawerB | Delete a drawer by ID. Irreversible. |
| palace_kg_queryA | Look up stable facts about one entity in the knowledge graph (subject → predicate → object triples added with palace_kg_add). Returns every matching fact with its direction, valid_from/valid_to dates, confidence, and whether it is still current. Read-only. Use it for durable facts such as 'which database does project X use'; use palace_search for free-text memories and palace_kg_timeline for a chronological history. |
| palace_kg_addB | Add a fact to the knowledge graph. Subject → predicate → object. |
| palace_kg_invalidateA | Mark a knowledge-graph fact as no longer true by setting its end date. The fact is kept as history (palace_kg_timeline and as_of queries still see it), not deleted. Only a currently open fact with exactly this subject, predicate and object is changed; if none matches, nothing changes. When a fact changes, call this on the old fact first and then palace_kg_add for the new one. |
| palace_kg_timelineA | List knowledge-graph facts in chronological order of valid_from (up to 100), including facts that have since been invalidated, so you can see how something changed over time. Read-only. Use it for 'what happened when' questions; use palace_kg_query for an entity's facts on a given date, and palace_diary_search for session history. |
| palace_kg_statsA | Return summary counts for the knowledge graph: number of entities, total triples, current versus ended facts, and the relationship types (predicates) in use. Read-only, no arguments. Use it to see whether the graph is populated or which predicates exist before calling palace_kg_query; for the drawer store use palace_status, and for the room graph use palace_graph_stats. |
| palace_seed_adoption_factsA | Write Palace's standard setup facts into the knowledge graph: the supported clients (Cursor, Codex, Claude Code, Claude Desktop), the memory protocol steps, and the memory routing rules, linked to the given project. Safe to re-run: facts that already exist are left unchanged and outdated ones are invalidated, and the result reports inserted, unchanged and invalidated counts. Use it once when adopting Palace in a project; for your own facts use palace_kg_add. |
| palace_traverseA | Explore related topics by walking outward from a room. Two rooms are connected when they share a wing; the walk goes breadth-first up to max_hops and returns up to 50 rooms with their wings, halls, drawer count, hop distance, and the wings they connect through. If the room does not exist it returns close name suggestions. Read-only. Use it to discover related areas; to find content use palace_search, and for explicit links you created use palace_follow_tunnels. |
| palace_find_tunnelsA | Find rooms that appear in more than one wing, i.e. shared topics that bridge projects (for example a 'testing' room in two repos). These bridges are computed from drawer placement, unlike the stored links made by palace_create_tunnel. Returns up to 50 rooms, most drawers first, with their wings, halls, drawer count and most recent date. Read-only. Use it to spot cross-project knowledge. |
| palace_graph_statsA | Return summary statistics for the room graph: total rooms, how many rooms bridge two or more wings, rooms per wing, and the top bridging rooms. Read-only, no arguments. Use it for a quick map of how projects overlap before calling palace_find_tunnels or palace_traverse; for knowledge-graph counts use palace_kg_stats. |
| palace_create_tunnelA | Store an explicit link (tunnel) between a room in one wing and a room in another, so palace_follow_tunnels can jump between related areas, e.g. an API repo's 'auth' room and a frontend repo's 'login' room. Wing names are normalised to slugs. The tunnel id is derived from its endpoints and kind, so creating the same tunnel twice is a no-op that returns the same id. Use it when the user points out a relationship palace_find_tunnels cannot infer. |
| palace_list_tunnelsA | List the explicit tunnels stored with palace_create_tunnel, newest first, with their ids, both wing/room endpoints, kind and creation time. Read-only. Use it to review links or find a tunnel_id for palace_delete_tunnel; to see the tunnels at one specific room use palace_follow_tunnels. |
| palace_delete_tunnelA | Permanently delete one explicit tunnel by id. Only the link is removed; the rooms and their drawers are untouched. Returns success=false if no tunnel had that id. Get ids from palace_list_tunnels or palace_follow_tunnels. Use only when the link is wrong or the user asks. |
| palace_follow_tunnelsA | List the explicit tunnels that touch one room in one wing, in either direction, so you can jump to the linked rooms elsewhere (then search or list drawers there). Read-only; returns each tunnel's id, endpoints, kind and creation time. Only stored tunnels from palace_create_tunnel are followed; for rooms related by shared wings use palace_traverse. |
| palace_get_drawerA | Fetch one drawer (a stored memory chunk) by its id, with its full content, wing, room, hall, source file, importance, timestamps and metadata. Read-only; returns an error if the id does not exist. Use it to read the whole drawer behind a search hit or citation; use palace_explain for provenance only and palace_search when you do not know the id. |
| palace_list_drawersA | List drawers with optional wing/room filters. Pass verbose=true for hall, chunk_index, created_at, metadata and detected entities. |
| palace_update_drawerA | Replace a drawer's content in place, keeping its id, wing, room and source. The old text is overwritten (no history kept), and the embedding, hall, detected entities and preference data are recomputed so search reflects the new text. Returns success=false if the id does not exist. Use it to correct a memory without changing its id; to add a new memory use palace_add_drawer, and to remove one use palace_forget. |
| palace_hook_settingsA | Report whether Palace's automatic client hooks are enabled: save_enabled (periodic memory saves during a session) and precompact_enabled (saving before the client compacts context). Read-only, no arguments, and both are currently always true. Use it only to check hook behaviour; hooks themselves are installed with the palace CLI, not through MCP. |
| palace_memories_filed_awayA | Signal that you have finished filing memories after a save prompt from a Palace hook. It stores nothing and always returns success=true; call it after palace_diary_write / palace_add_drawer when a hook asked you to save, so the hook knows the save step is done. No arguments, no side effects. |
| palace_list_agentsA | List the agent names that have a diary in this palace (for example claude-code, codex, cursor). Read-only, no arguments. Use it to find which agent_name to pass to palace_diary_read, or to see who else has worked here before searching all diaries with palace_diary_search all_agents=true. |
| palace_diary_writeB | Write to your personal agent diary. Supports session metadata for warm-start context. |
| palace_diary_readA | Read an agent's most recent diary entries, newest first, with date, topic, session id, tags and text. Read-only. Use it to review what an agent did lately in order; use palace_diary_search to find entries about a subject, and palace_session_context for warm-start context at session start. |
| palace_diary_searchB | Semantic search within diary entries. Set all_agents=true to recall investigations recorded by any agent (cross-agent continuity). |
| palace_session_contextA | Get warm-start context from recent diary entries. Falls back to other agents' recent work for the project when you have none of your own. |
| palace_rememberA | File a key fact with high importance (5.0). Shortcut for palace_add_drawer with importance=5. |
| palace_forgetB | Delete a drawer by ID. Use when a memory is outdated or incorrect. |
| palace_explainA | Return full provenance for a drawer: who filed it, when, from which source file, and its importance. |
| palace_preference_searchA | Search drawers tagged as preferences or conventions. Use when asking what the user prefers, their coding style, or standing rules. |
| palace_exportA | Export all palace drawers as a portable JSON snapshot (embeddings excluded). Use for backup or migration. |
| palace_importA | Import drawers from a JSON snapshot produced by palace_export. Skips drawers that already exist (idempotent). |
| palace_upgrade_embeddingsA | Re-embed all drawers with the palace's active embedding model (batched). To switch models use palace_embeddings. |
| palace_embeddingsA | Embedding model management. action=list shows models; status shows the active model and any migration; estimate measures cost of switching to |
| palace_pruneA | Delete drawers filed more than N days ago. Use to keep the palace lean. Irreversible, so export first if unsure. |
| palace_memory_reportA | Human-readable overview of what the palace remembers: profile, total drawers, wings and rooms with counts, recent diary topics, and top remembered facts. Use this to inspect memory without a UI, ideal for non-developer users who want to see what's stored. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| continue-session | Load Palace memory before you start: recent work, decisions, and context. |
| save-session | Save what happened this session to Palace memory so it carries over next time. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 50 tools
The set contains several near-duplicate or overlapping tools: palace_forget and palace_delete_drawer both delete by ID, palace_remember is a shortcut for palace_add_drawer, and palace_status / palace_project_status / palace_memory_report serve related overview needs. Graph, tunnel, and diary discovery tools also have subtle boundaries that require reading long descriptions to distinguish.
All tools use a consistent palace_ prefix and snake_case, with readable subnamespaces such as palace_kg_*, palace_diary_*, and palace_*_tunnel. However, many names are noun-like or action-only (palace_status, palace_gain, palace_mine, palace_prune) rather than a strict verb_noun pattern.
At 50 tools, the surface is far beyond the typical well-scoped range and includes many niche, administrative, and alias-like operations. The count creates a high discovery and selection burden for an agent, even for a broad memory-management domain.
Coverage is broad: drawers, wings, rooms, knowledge graph, tunnels, diaries, embeddings, import/export, verification, and reporting are all represented. Minor lifecycle gaps remain, such as no clear wing/room deletion or drawer-move operation, and tunnels can be created/deleted but not updated.