Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

delete_repository

Remove a Bitbucket Cloud repository permanently. Specify workspace and repository slugs to delete repositories irreversibly.

Instructions

Delete a repository. This action is irreversible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug

Implementation Reference

  • The switch case handler for the 'delete_repository' tool. It validates the input parameters using the Zod schema, calls RepositoriesAPI.delete to perform the deletion, and returns a success message.
    case 'delete_repository': {
      const params = toolSchemas.delete_repository.parse(args);
      await this.repos.delete(params);
      return { success: true, message: 'Repository deleted' };
    }
  • Zod input schema definition for the 'delete_repository' tool, specifying required workspace and repo_slug parameters.
    delete_repository: z.object({
      workspace: z.string().describe('The workspace slug'),
      repo_slug: z.string().describe('The repository slug'),
    }),
  • Tool registration in the toolDefinitions array for MCP, including name, description, and JSON schema for input validation.
    {
      name: 'delete_repository',
      description: 'Delete a repository. This action is irreversible.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          workspace: { type: 'string', description: 'The workspace slug' },
          repo_slug: { type: 'string', description: 'The repository slug' },
        },
        required: ['workspace', 'repo_slug'],
      },
    },
  • The RepositoriesAPI.delete method, which makes the actual Bitbucket API DELETE request to remove the repository.
    async delete(params: GetRepositoryParams): Promise<void> {
      const { workspace, repo_slug } = params;
      await this.client.delete(`/repositories/${workspace}/${repo_slug}`);
    }

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/Lexmata/bitbucket-mcp'

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