Delete Diagram
diagrams_deleteDelete a PlantUML or Mermaid diagram file permanently from the diagrams root. Use to remove outdated or unwanted diagrams; the action cannot be undone.
Instructions
Delete a single PlantUML or Mermaid diagram file from the diagrams root.
This is destructive and cannot be undone — the file is removed from disk. To replace content instead, use diagrams_update. To remove then recreate with different content, delete first, then use diagrams_create.
Args:
relative_path (string): Path to the diagram relative to the diagrams root, as returned by diagrams_list
Returns: JSON with schema: { "relative_path": string, "deleted": true }
Examples:
Use when: "Remove the outdated order-flow diagram" -> relative_path="system/order-flow.puml"
Don't use when: You want to change the diagram content but keep the file (use diagrams_update)
Error Handling:
Returns "Error: No diagram found at ''" if the file doesn't exist
Returns "Error: Refused to access path outside the diagrams root" if relative_path attempts to escape the diagrams directory (e.g. via '../..')
Unexpected internal failures return a generic "Error: Unexpected internal error ..." with isError:true and are logged to stderr without source, paths, or secrets
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relative_path | Yes | Path to the diagram to delete, relative to the diagrams root (e.g. 'system/order-flow.puml'). Get this from diagrams_list. |