Skip to content

Tools Reference

MemLayer exposes four MCP tools. Claude calls these automatically based on conversation context.


Store information the user wants remembered. Use when the user says “remember”, shares preferences, or provides facts about themselves.

ParameterTypeRequiredDescription
contentstringYesThe fact to remember. Write in third person: “User prefers X” not “I prefer X”
sourcestringNoOrigin identifier: conversation, user_stated, or inferred

Example call:

{
"content": "User's favorite programming language is Haskell",
"source": "user_stated"
}

When Claude uses it: User says “Remember that my favorite language is Haskell.” Claude extracts the fact, rephrases it in third person, and calls retain.

Maps to: POST /api/v1/retain


Search stored memories. Claude calls this before answering questions about user preferences, history, or previously shared information.

ParameterTypeRequiredDescription
querystringYesNatural language search. Be specific: “programming language preference” not just “language”
limitintegerNoMax results (default: 5). Use 10+ for broad searches

Example call:

{
"query": "favorite programming language",
"limit": 5
}

When Claude uses it: User asks “What’s my favorite language?” Claude searches for semantically similar memories and uses the results to answer.

Maps to: GET /api/v1/recall


Consolidate related memories into higher-level summaries. Use sparingly — only when the user asks to organize memories or after many retain calls.

ParameterTypeRequiredDescription
querystringNoOnly consolidate memories about this topic

Example call:

{
"query": "programming"
}

When Claude uses it: User says “Organize my memories about programming.” Claude scopes the reflection to programming-related facts.

Maps to: POST /api/v1/reflect


Permanently delete an entity and all its data (memories, relationships, embeddings). Use when explicitly asked to forget something.

ParameterTypeRequiredDescription
entity_idstringYesThe entity_id to forget (get this from recall results)

Example call:

{
"entity_id": "user-haskell-preference"
}

When Claude uses it: User says “Forget my programming preferences.” Claude first calls recall to find matching memories, reads the entity_id from the results, then calls forget with that ID.

Maps to: POST /api/v1/forget


When Claude connects to MemLayer via MCP, it receives the tool definitions automatically through the tools/list JSON-RPC method. The descriptions guide Claude on when and how to use each tool.

You can inspect the raw tool definitions in the source at src/MemLayer/MCP/Tools.hs.