5.4-c Delete and destructive tools (phase 2)
- Dominant language
- JavaScript
- Stars
- 400
- Forks
- 89
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 149
Description
**Parent:** #7673 (5.4 Teams and membership)
**Tool file:** `forge/ee/lib/mcp/tools/teams.js` (extend), new `forge/ee/lib/mcp/tools/members.js`
`destructiveHint: true`. Kept separate from ordinary writes so MCP clients gate them behind confirmation by default. Each destructive endpoint is one tool.
| Tool | Endpoint | Scope | Annotation |
|---|---|---|---|
| `platform_remove_team_member` | `DELETE /teams/:teamId/members/:userId` | `team:user:remove` | destructive |
| `platform_revoke_team_invitation` | `DELETE /teams/:teamId/invitations/:invitationId` | `team:user:invite` | destructive |
**Design notes:**
- Membership role-change and member removal are not siblings; removal is a distinct destructive tool.
**Tool definitions (description + zod inputSchema):**
```js
platform_remove_team_member: {
description: 'Remove a member from a team. Removing the last owner returns a 400.',
inputSchema: z.object({
teamId: z.string().describe('Team hashid'),
userId: z.string().describe('User hashid of the member to remove')
})
}
platform_revoke_team_invitation: {
description: 'Revoke a pending team invitation.',
inputSchema: z.object({
teamId: z.string().describe('Team hashid'),
invitationId: z.string().describe('Invitation hashid to revoke')
})
}
```
**Tests:**
- Every tool carries `destructiveHint: true`.
- Remove and revoke rejected for read-only PAT.
---
Contributor guide
Research direction
Start in forge/ee/lib/mcp/tools/teams.js and review its existing tool definitions, then create forge/ee/lib/mcp/tools/members.js for the invitation tool. Check the MCP tool tests and verify both destructive endpoints use the specified schemas, carry destructiveHint: true, and reject read-only PATs.
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