Skip to main content
Glama
Kallows

MCP Bitbucket Python

by Kallows

bb_delete_repository

Removes a specified repository from Bitbucket by providing the repository slug and optional workspace. Simplifies repository management within the MCP Bitbucket Python server.

Instructions

Delete a repository from Bitbucket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_slugYesThe repository slug to delete
workspaceNoTarget workspace (defaults to kallows, can use ~ for personal workspace)kallows

Implementation Reference

  • Handler implementation within the main call_tool function. Resolves workspace (handles '~' for personal), sends DELETE request to Bitbucket API endpoint for the repository, handles success (204) and error responses with permission formatting.
    elif name == "bb_delete_repository":
        workspace = arguments.get("workspace", "kallows")
        if workspace == "~":
            user_url = "https://api.bitbucket.org/2.0/user"
            user_response = requests.get(user_url, auth=auth, headers=headers)
            if user_response.status_code != 200:
                return [types.TextContent(
                    type="text",
                    text=f"Failed to get user info: {user_response.status_code} - {format_permission_error(user_response.text)}",
                    isError=True
                )]
            workspace = user_response.json().get('username')
    
        repo_slug = arguments.get("repo_slug")
        url = f"https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}"
        response = requests.delete(url, auth=auth, headers=headers)
    
        if response.status_code == 204:
            return [types.TextContent(
                type="text",
                text=f"Repository {repo_slug} deleted successfully from workspace '{workspace}'"
            )]
        else:
            error_msg = format_permission_error(response.text)
            if workspace == "kallows" and "permission" in error_msg.lower():
                error_msg += "\n\nTip: You can try deleting the repository from your personal workspace by setting workspace='~'"
            
            return [types.TextContent(
                type="text",
                text=f"Failed to delete repository: {response.status_code}\n{error_msg}",
                isError=True
            )]
  • Tool registration in the list_tools handler, defining the tool name, description, and input schema for validation.
    types.Tool(
        name="bb_delete_repository",
        description="Delete a repository from Bitbucket", # TODO: only works with delete repo priv, see if app password can get delete repo privilege
        inputSchema={
            "type": "object",
            "properties": {
                "repo_slug": {
                    "type": "string",
                    "description": "The repository slug to delete"
                },
                "workspace": {
                    "type": "string",
                    "description": "Target workspace (defaults to kallows, can use ~ for personal workspace)",
                    "default": "kallows"
                }
            },
            "required": ["repo_slug"]
        }
    ),
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Delete' implies a destructive operation, it doesn't specify whether deletion is permanent or reversible, what happens to associated data, or any rate limits/authentication requirements. This is a significant gap for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple destructive operation and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no annotations and no output schema, the description is insufficient. It doesn't address critical context like whether deletion is permanent, what permissions are required, what happens on success/failure, or how this differs from other deletion operations in the sibling set.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and target resource ('a repository from Bitbucket'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling deletion tools like 'bb_delete_file' or 'bb_delete_issue' beyond specifying the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (like permissions needed), when deletion is appropriate versus other operations, or how this differs from other deletion tools in the sibling list.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Kallows/mcp-bitbucket'

If you have feedback or need assistance with the MCP directory API, please join our Discord server