Delete Memories by Context
delete_by_contextPermanently bulk-delete all memories whose context array contains an exact [key, value] pair (destructive, idempotent; consumes 1 Write API call) and return { deleted_count }. Scopes deletion to namespace when provided, or across all namespaces in your organization when namespace is omitted (rejecting reserved "org:" prefixes). Use to purge memories tied to a deleted file, PR, or feature tag; use forget_memory instead when deleting a single memory by UUID.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"key": "<key>",
"value": "<value>"
},
"name": "delete_by_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Exact context tuple key to match (for example "file" or "pr"). | |
| value | Yes | Exact context tuple value to match (for example "src/legacy.js"). | |
| namespace | No | Optional logical namespace filter; omit to match across the entire organization. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deleted_count | Yes | Number of matching memories deleted (0 if none matched). |