> This page is for Agent Handler.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Bitbucket

**Authentication:** OAuth. See [Magic Link](/merge-agent-handler/features/magic-link) for the runtime auth flow, or [Application credentials](/merge-agent-handler/admin-setup/add-oauth-credentials) to bring your own OAuth app.

## Sample use cases

* List open pull requests in the `acme/api` repo that haven't had a review in 3 days.
* Open a pull request from `feature/auth` into `main` with the commit log as the body.
* Find every repo with no commits in the last 90 days for archive review.

## Available Tools

#### list\_branches

List repository branches

#### get\_branch

Get branch details by name

#### create\_branch

Create a new branch

#### delete\_branch

Delete a branch

#### get\_default\_branch

Get repository default branch

#### list\_commits

List repository commits with filters

#### get\_commit

Get commit details by hash

#### get\_commit\_diff

Get commit diff

#### approve\_commit

Approve a commit

#### unapprove\_commit

Remove commit approval

#### list\_commit\_statuses

List commit build statuses

#### list\_commit\_comments

List commit comments

#### list\_pipelines

List repository pipelines

#### get\_pipeline

Get pipeline details by UUID

#### trigger\_pipeline

Trigger a new pipeline run

#### stop\_pipeline

Stop a running pipeline

#### list\_pipeline\_steps

List pipeline steps

#### get\_pipeline\_step

Get pipeline step details

#### get\_pipeline\_step\_log

Get pipeline step logs

#### list\_pipeline\_variables

List pipeline variables

#### list\_pullrequests

List pull requests with filtering options

#### get\_pullrequest

Get pull request details by ID

#### create\_pullrequest

Create a new pull request

#### update\_pullrequest

Update pull request details

#### merge\_pullrequest

Merge a pull request

#### decline\_pullrequest

Decline a pull request

#### approve\_pullrequest

Approve a pull request

#### unapprove\_pullrequest

Remove approval from a pull request

#### list\_pullrequest\_comments

List pull request comments

#### create\_pullrequest\_comment

Add a comment to a pull request

#### list\_pullrequest\_commits

List pull request commits

#### get\_pullrequest\_diff

Get pull request diff

#### list\_pullrequest\_statuses

List pull request build statuses

#### get\_pullrequest\_activity

Get pull request activity log

#### request\_pullrequest\_changes

Request changes on a pull request

#### list\_repositories

List repositories in a workspace with pagination

#### get\_repository

Get repository details by slug

#### create\_repository

Create a new repository in a workspace

#### update\_repository

Update repository settings

#### delete\_repository

Delete repository permanently

#### list\_repository\_forks

List repository forks

#### fork\_repository

Fork a repository

#### list\_repository\_watchers

List repository watchers

#### get\_current\_user

Get authenticated user profile

#### list\_user\_emails

List user email addresses

#### list\_workspaces

List accessible workspaces

#### get\_workspace

Get workspace details

#### list\_workspace\_members

List workspace members

#### list\_webhooks

List repository webhooks

#### get\_webhook

Get webhook details by UUID

#### create\_webhook

Create a repository webhook

#### update\_webhook

Update webhook configuration

#### delete\_webhook

Delete webhook permanently