Skip to content

Tools Reference

memcp Tools Reference

All tools are exposed via the Model Context Protocol. Agents call them the same way they call any other MCP tool.


store_memory

Store a new memory in memcp.

Parameters

NameTypeRequiredDescription
contentstringYesThe text content to store
tagsstring[]NoLabels for categorization and filtering
agent_idstringNoAgent identifier. Defaults to the calling agent.
importancenumberNoInitial salience weight (0.0–1.0). Default: 0.5
metadataobjectNoArbitrary key-value pairs attached to the memory

Example call

{
"tool": "store_memory",
"arguments": {
"content": "User prefers responses in bullet points. Dislikes verbose prose.",
"tags": ["preference", "formatting"],
"importance": 0.8
}
}

Example response

{
"id": "mem_01jk9x8zy3",
"content": "User prefers responses in bullet points...",
"tags": ["preference", "formatting"],
"salience": 0.8,
"created_at": "2025-06-01T12:34:56Z"
}

search_memories

Hybrid BM25+vector search across stored memories.

Parameters

NameTypeRequiredDescription
querystringYesSearch query (semantic or keyword)
limitnumberNoMaximum results to return. Default: 10
tagsstring[]NoFilter to memories with ALL of these tags
agent_idstringNoRestrict to a specific agent’s memories
min_saliencenumberNoOnly return memories with salience above this threshold

Example call

{
"tool": "search_memories",
"arguments": {
"query": "user formatting preferences",
"limit": 5,
"tags": ["preference"]
}
}

Example response

{
"memories": [
{
"id": "mem_01jk9x8zy3",
"content": "User prefers responses in bullet points...",
"tags": ["preference", "formatting"],
"salience": 0.78,
"score": 0.92,
"created_at": "2025-06-01T12:34:56Z"
}
],
"total": 1
}

recall

Automatically surface the most relevant memories for the current context. Combines salience weighting with hybrid search.

Parameters

NameTypeRequiredDescription
contextstringYesCurrent message or conversation turn to recall against
limitnumberNoMaximum memories to return. Default: 5
agent_idstringNoRestrict to a specific agent’s memories

Example call

{
"tool": "recall",
"arguments": {
"context": "The user is asking about their project deadline.",
"limit": 5
}
}

Example response

{
"memories": [
{
"id": "mem_01jk9x3ab2",
"content": "Project Alpha deadline is July 15th. User confirmed this is hard.",
"tags": ["project", "deadline"],
"salience": 0.91,
"created_at": "2025-05-28T09:00:00Z"
}
]
}

delete_memory

Remove a memory by ID.

Parameters

NameTypeRequiredDescription
idstringYesMemory ID to delete

Example call

{
"tool": "delete_memory",
"arguments": {
"id": "mem_01jk9x8zy3"
}
}

Example response

{
"deleted": true,
"id": "mem_01jk9x8zy3"
}

list_memories

List recent memories with optional filtering. Useful for inspection and auditing.

Parameters

NameTypeRequiredDescription
limitnumberNoNumber of entries to return. Default: 20, max: 100
offsetnumberNoPagination offset. Default: 0
tagsstring[]NoFilter by tags
agent_idstringNoFilter by agent
orderstringNocreated_at_desc (default), created_at_asc, salience_desc

Example call

{
"tool": "list_memories",
"arguments": {
"limit": 10,
"order": "salience_desc"
}
}

Example response

{
"memories": [
{
"id": "mem_01jk9x3ab2",
"content": "Project Alpha deadline is July 15th...",
"tags": ["project", "deadline"],
"salience": 0.91,
"created_at": "2025-05-28T09:00:00Z"
}
],
"total": 47,
"limit": 10,
"offset": 0
}