apply_plan
Executes a saved cleanup plan by plan ID, re-verifying each action before archiving empty files, duplicates, or orphan attachments; stale actions are skipped and nothing is permanently deleted.
Instructions
Execute a cleanup plan created by plan_cleanup, by its plan ID. Archives each action in the plan (empty files, duplicate files, orphan attachments) after re-verifying it; nothing is ever permanently deleted.
Before executing, each action is re-verified against the library: the path must still exist, the SHA-256 and modification time must match the plan, and the reason must still hold (empty file still empty, duplicate group still intact, orphan still unreferenced). Actions that no longer hold are skipped with the reason, and the rest still execute.
Plans older than 7 days are rejected. A plan ID that does not exist or is malformed is reported, and nothing is changed. The search index is refreshed incrementally after execution, so the next search reflects the change. A plan that has been executed is retired; running it again reports that it was already applied.
Use this when the user asks to execute a plan in chat (for example "执行这个清理计划"). The command-line memdrive-mcp apply <plan-id> does the same thing from a terminal.
Never call this tool automatically right after plan_cleanup. Always show the user the plan preview and plan ID first and wait for their explicit confirmation in the chat before calling.
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": {
"plan_id": "<plan_id>"
},
"name": "apply_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan_id | Yes | Plan ID returned by plan_cleanup (for example "20261114054412-c4ad79"). |