FlowFuse / FlowFuse/flowfuse

5.13-c Delete and destructive tools (phase 2)

Open
#7,713 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:** #7682 (5.13 Broker and MQTT (special review))
**Tool file:** new `forge/ee/lib/mcp/tools/broker.js`

`destructiveHint: true`. **Contingent on a product decision to allow broker mutation over MCP.** Neither tool mints credentials, so #7513 does not block them. One tool per delete endpoint.

| Tool | Endpoint | Scope | Annotation |
|---|---|---|---|
| `platform_delete_broker_topic` | `DELETE /teams/:teamId/brokers/:brokerId/topics/:topicId` | `broker:topics:write` | destructive |
| `platform_delete_broker_client` | `DELETE /teams/:teamId/broker/client/:username` | `broker:clients:delete` | destructive |

**Design notes:**
- The topic delete route uses a plain `needsPermission('broker:topics:write')` (it is **not** dual-gated, unlike GET/POST topics), and its path is a single `:topicId` param, not a wildcard.
- `delete_broker_client` (`broker:clients:delete`, Owner) removes a broker client. It does **not** issue credentials, so it is not in the #7513 class; it belongs with the rest of the contingent broker write/delete surface.
- The whole surface is gated by the enterprise license tier and the per-team `teamBroker` feature flag.

**Tool definitions (description + zod inputSchema):**
```js
platform_delete_broker_topic: {
description: 'Deletes a broker topic.',
inputSchema: z.object({
teamId: z.string().describe('team hashid'),
brokerId: z.string().describe("broker id: either the literal 'team-broker' or a 3rd-party broker hashid"),
topicId: z.string().describe('topic hashid')
})
},
platform_delete_broker_client: {
description: 'Deletes a team broker client.',
inputSchema: z.object({
teamId: z.string().describe('team hashid'),
username: z.string().describe('Username of the broker client to delete')
})
}
```

**Tests (only if writes approved):**
- The tool carries `destructiveHint: true`.
- Read-only PAT rejected.

---

Contributor guide

Open the contributing guide

Research direction

First confirm the product decision to allow broker mutation over MCP. Then inspect the new forge/ee/lib/mcp/tools/broker.js file and add the two specified delete tool definitions with their schemas and destructive annotations; if writes are approved, verify destructiveHint is true and read-only PATs are rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, devtools
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.