Skip to content

PRD: Add Delete Plan MCP Tool

Project: ai-plans Date: 2026-02-12 Status: draft

Context

Currently there's no way to delete plans through MCP. Users have to manually delete folders or use git commands. Need a safe way to remove plans that are no longer needed.

Goals

  • Add delete_plan MCP tool
  • Safely remove plan folder and all files
  • Update index.md after deletion
  • Create git commit with deletion
  • Prevent accidental deletions with confirmation

Requirements

Functional

  • Add delete_plan tool to MCP server
  • Delete entire plan folder (project/task/)
  • Update main index.md
  • Create git commit
  • Return confirmation message
  • Handle errors gracefully (plan not found, etc.)

Non-functional

  • Safe operation (no accidental deletions)
  • Clear error messages
  • Fast execution (<1s)

Technical Approach

  1. New tool: delete_plan
  2. Parameters: project, task
  3. Validate plan exists
  4. Delete folder recursively
  5. Update index.md
  6. Git commit with message
  7. Return success/error

  8. Safety considerations:

  9. Check if plan exists before deleting
  10. No confirmation prompt (user decides when to call)
  11. Clear error if plan not found
  12. Git commit allows recovery if needed

  13. Implementation:

  14. Add src/tools/delete-plan.ts
  15. Use fs.rm(path, { recursive: true })
  16. Call updateIndexPage()
  17. Call commitDocs()
  18. Register in server.ts

Constraints and Risks

  • Deletion is permanent (until git revert)
  • Need to handle edge cases (empty folders, etc.)
  • Should we delete empty project folders?

Open Questions

  • Should we require confirmation parameter?
  • Delete empty project folder if last task removed?
  • Add to steering rules?