Skip to content

PRO-1940: feat(mcp): add delete_branch tool - #30

Merged
prat11m merged 1 commit into
mainfrom
feature/pro-1940-featmcp-add-delete_branch-tool
Jul 24, 2026
Merged

PRO-1940: feat(mcp): add delete_branch tool#30
prat11m merged 1 commit into
mainfrom
feature/pro-1940-featmcp-add-delete_branch-tool

Conversation

@prat11m

@prat11m prat11m commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a delete_branch MCP tool — the connector could create/rename/make-live/read branches but had no way to delete one, so deletion requests failed (no tool was wired to the backend).
  • Calls the existing backend endpoint POST /agent/:id/branches/:branchId/archive (soft-delete: archives the branch, its revisions, and its open draft).
  • Surfaces backend guards: the default branch cannot be deleted, and the live branch cannot be deleted (make another branch live first).

Test plan

  • npm run build + npx tsc --noEmit pass (verified locally)
  • delete_branch deletes a non-live, non-default branch
  • Deleting the live branch returns the "make another branch live first" error
  • Deleting the default branch is rejected
  • Deleting a non-existent branch_id returns "Branch not found"

Linear

PRO-1940

🤖 Generated with Claude Code

Wire a delete_branch tool to the backend archive endpoint
(POST /agent/:id/branches/:branchId/archive). Guards surfaced:
default and live branches cannot be deleted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@prat11m
prat11m merged commit 1014ded into main Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants