FlowFuse / FlowFuse/flowfuse

5.2-c Delete and destructive tools (phase 2)

Open
#7,689 0 comments 0 reactions 0 assignees View on GitHub
story
Dominant language
JavaScript
Stars
400
Forks
89
Avg merge
1d 20h
Merged PRs (30d)
149

Description

**Parent:** #7671 (5.2 Snapshot lifecycle)
**Tool file:** `forge/ee/lib/mcp/tools/snapshots.js` (extend)

`destructiveHint: true`. Kept separate from ordinary writes so MCP clients gate them behind confirmation by default.

| Tool | Endpoint | Scope | Annotation |
|---|---|---|---|
| `platform_delete_snapshot` | `DELETE /snapshots/:id` | `snapshot:delete` | destructive |

**Consolidation notes:**
- Delete is a single tool: `platform_delete_snapshot` takes a snapshot id and the generic route resolves the owner (instance or device) team from the snapshot, so separate instance-scoped delete tools are not needed.

**Tool definitions (description + zod inputSchema):**
```js
platform_delete_snapshot: {
description: 'Delete a snapshot by snapshot id; the owner (instance or device) team is resolved from the snapshot.',
inputSchema: z.object({
id: z.string().describe('ProjectSnapshot id (opaque hashid), not a project UUID, to delete')
})
}
```

**Tests:**
- The tool carries `destructiveHint: true`.
- Delete rejected for read-only PAT.
- Delete resolves the owner from the snapshot for both instance- and device-owned snapshots.

---

Contributor guide

Open the contributing guide

Research direction

Start in forge/ee/lib/mcp/tools/snapshots.js and inspect the existing snapshot tool definitions and their tests. Add the platform_delete_snapshot definition with its destructive annotation and input schema, then verify the listed cases: read-only PAT rejection and owner resolution for both instance- and device-owned snapshots.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.