Bitbucket
BitbucketTools enables agents to interact with Bitbucket repositories for managing code, pull requests, and issues.
Prerequisites
The following example requires the requests and openai libraries.
uv pip install agno requests openaiexport BITBUCKET_USERNAME="your-atlassian-account@example.com"
export BITBUCKET_TOKEN="your-scoped-api-token"The Agent model uses an OpenAI key, separately from any toolkit provider credentials.
Set OpenAI Key
Set your OPENAI_API_KEY as an environment variable. You can get one from OpenAI.
export OPENAI_API_KEY=sk-***Bitbucket Cloud disabled app passwords on June 9, 2026. Use your Atlassian account email and a scoped API token; this toolkit sends them as HTTP Basic credentials. For the pull-request example, grant read:pullrequest:bitbucket and use a workspace/repository the account can access. See API token permissions.
Example
The following agent can manage Bitbucket repositories:
from agno.agent import Agent
from agno.tools.bitbucket import BitbucketTools
agent = Agent(
instructions=[
"You are a Bitbucket repository management assistant",
"Help users manage their Bitbucket repositories, pull requests, and issues",
"Provide clear information about repository operations",
"Handle errors gracefully and suggest solutions",
],
tools=[BitbucketTools(
workspace="your-workspace",
repo_slug="your-repository"
)],
)
agent.print_response("List all pull requests for this repository", stream=True)Toolkit Params
| Parameter | Type | Default | Description |
|---|---|---|---|
server_url | str | "api.bitbucket.org" | Base host for the Cloud REST API; operations use Cloud API paths. |
username | Optional[str] | None | Atlassian account email for API-token auth; falls back to BITBUCKET_USERNAME. |
password | Optional[str] | None | Basic-auth secret fallback from BITBUCKET_PASSWORD when token is absent; app passwords are retired. |
token | Optional[str] | None | Scoped API token paired with account email; falls back to BITBUCKET_TOKEN. Not a Bearer OAuth token. |
workspace | Optional[str] | None | Bitbucket workspace name (required). |
repo_slug | Optional[str] | None | Repository slug name (required). |
api_version | str | "2.0" | Bitbucket API version to use. |
timeout | int | 30 | Request timeout in seconds. |
Toolkit Functions
| Function | Description |
|---|---|
list_repositories | List repositories in the workspace. |
get_repository_details | Get detailed information about the repository. |
create_repository | Create a new repository in the workspace. |
list_repository_commits | List commits in the repository. |
list_all_pull_requests | List pull requests in the repository, filtered by state. |
get_pull_request_details | Get details of a specific pull request. |
get_pull_request_changes | Get the diff of a pull request. |
list_issues | List issues in the repository. |
You can use include_tools or exclude_tools to modify the list of tools the agent has access to. Learn more about selecting tools.