Skip to content

delete_branch

Delete a branch from a project. The default branch (main) cannot be deleted. Typically used to clean up scenario branches after merge_branch or merge_pull_request. Requires Owner role. DESTRUCTIVE — defaults to dry_run=True and returns a confirmation_token. To execute: call again with dry_run=False and echo the token.

destructive

NameTypeRequiredDefaultDescription
project_nameAnnotated[str, Field(description='Name of the Bridge Town project.')]Yes
branch_nameAnnotated[str, Field(description='Name for the new branch. Must be a valid git ref name (no spaces, no special chars except hyphens and underscores.')]Yes
dry_runAnnotated[bool, Field(description='Preview the deletion without mutating anything.')]NoTrue
confirmation_token`Annotated[strNone, Field(description=‘Token required to confirm deletion (returned by a dry run).’)]`NoNone

Returns a structured object. Top-level fields:

  • project (string)
  • branch (string)
  • deleted (boolean)

See the response example below for the full payload shape.

{
"name": "delete_branch",
"arguments": {
"project_name": "forecasts",
"branch_name": "scenario/aggressive-growth"
}
}
{
"project": "forecasts",
"branch": "scenario/aggressive-growth",
"deleted": true
}
  • Module: Branches
  • Requires authentication via API token or Auth0 JWT.