Skip to main content
Glama
Kallows

MCP Bitbucket Python

by Kallows

bb_delete_file

Remove files from a Bitbucket repository using a commit, specifying workspace, repo slug, file path, and branch. Streamline file deletion with automated commit messages.

Instructions

Delete a file from a Bitbucket repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNoBranch name (defaults to main/master)main
messageNoCommit message for the deletionDelete file via MCP
pathYesPath to the file to delete
repo_slugYesRepository slug/name
workspaceNoRepository workspace (defaults to kallows)kallows

Implementation Reference

  • Handler logic for bb_delete_file tool: deletes file by posting empty content to Bitbucket src endpoint.
    elif name == "bb_delete_file":
        workspace = arguments.get("workspace", "kallows")
        repo_slug = arguments.get("repo_slug")
        file_path = arguments.get("path")
        message = arguments.get("message", "Delete file via MCP")
        branch = arguments.get("branch", "main")
    
        url = f"https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/src"
        
        # In Bitbucket, file deletion is done by posting an empty file
        files = {
            file_path: (None, "")
        }
        data = {
            'message': message,
            'branch': branch
        }
    
        response = requests.post(url, auth=auth, files=files, data=data)
    
        if response.status_code in (200, 201):
            return [types.TextContent(
                type="text",
                text=f"File {file_path} deleted successfully"
            )]
        else:
            return [types.TextContent(
                type="text",
                text=f"Failed to delete file: {response.status_code}\n{format_permission_error(response.text)}",
                isError=True
            )]
  • Registration of bb_delete_file tool in list_tools(), including input schema.
    types.Tool(
        name="bb_delete_file",
        description="Delete a file from a Bitbucket repository",
        inputSchema={
            "type": "object",
            "properties": {
                "workspace": {
                    "type": "string",
                    "description": "Repository workspace (defaults to kallows)",
                    "default": "kallows"
                },
                "repo_slug": {
                    "type": "string",
                    "description": "Repository slug/name"
                },
                "path": {
                    "type": "string",
                    "description": "Path to the file to delete"
                },
                "message": {
                    "type": "string",
                    "description": "Commit message for the deletion",
                    "default": "Delete file via MCP"
                },
                "branch": {
                    "type": "string",
                    "description": "Branch name (defaults to main/master)",
                    "default": "main"
                }
            },
            "required": ["repo_slug", "path"]
        }
    ),
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. It states the action is 'Delete,' implying a destructive mutation, but doesn't mention critical details like whether deletion is permanent, requires specific permissions, affects repository history, or has rate limits. 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, clear sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and efficiently conveys the core action, making it easy for an agent to parse quickly.

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 mutation tool with no annotations and no output schema, the description is incomplete. It lacks behavioral context (e.g., permanence, permissions), output expectations, and usage guidelines relative to siblings. Given the complexity and risk of file deletion, more information is needed to adequately guide an agent.

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 fully documents all 5 parameters. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain path formats or branch implications). Baseline 3 is appropriate when the schema handles parameter documentation.

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 resource ('a file from a Bitbucket repository'), making the purpose immediately understandable. It distinguishes from siblings like bb_delete_issue and bb_delete_repository by specifying 'file' as the target. However, it doesn't explicitly contrast with bb_write_file for file operations, keeping it from a perfect score.

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 (e.g., needing write permissions), compare with siblings like bb_write_file for file modifications, or indicate when deletion is appropriate versus other actions. This leaves the agent without contextual usage cues.

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