delete_concept
Delete a concept file with a safety-first dry-run that previews backlinks, refuses deletion while references exist, and supports force removal or mtime conflict guard.
Instructions
⚠ DESTRUCTIVE — permanently deletes the vault .md file. Two-stage safety:
Both preview and confirmed responses identify the node by permanent uid plus current slug. 1. Without confirm: true the call is a dry-run — returns a backlinks preview without deleting.
2. If any backlinks exist the call throws — refuses while other nodes still reference this slug. Pass force: true to delete anyway (the referrers become dangling).
Successful deletion returns the frontmatter + body so a user who deleted by mistake can recreate the node via add_concept. Directories are left untouched. Pass expected_mtime to guard against concurrent external edits — throws if the file changed on disk since you read it. Confirmed deletes return compact postWriteMaintenance (maintenance_plan) with count-safe byPhase / bySeverity / byKind queue buckets, action score, executable proposedAction, and current-page nextExecutableAction / nextReviewAction pointers for the final graph.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | Vault-relative slug (omit the .md extension). | |
| force | No | Delete even when backlinks exist (referrers become dangling). Defaults to false. | |
| confirm | No | Actually delete when true. Omit or false for a dry-run (backlinks preview, no delete). | |
| expected_mtime | No | Optional conflict guard — file mtimeMs at read time. If it differs at delete time, the call throws. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| uid | Yes | ||
| slug | Yes | ||
| dryRun | Yes | ||
| forced | No | ||
| changed | No | ||
| message | No | ||
| captured | No | ||
| filePath | Yes | ||
| backlinks | No | ||
| canConfirm | Yes | True only when repeating the call with confirm:true can perform the previewed change without another explicit safety opt-in. | |
| wouldChange | Yes | True only when the dry-run predicts a disk or Git change. | |
| previewReady | Yes | True only when this response is a complete dry-run preview that an agent can review. | |
| blockedReasons | Yes | Machine-readable human explanations for every condition currently blocking confirmation. | |
| backlinksAtDelete | No | ||
| postWriteMaintenance | No | Compact maintenance_plan summary for post-write follow-up. Bucket maps describe the remaining queue after the write. |