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
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug |
Implementation Reference
- src/tools/index.ts:916-920 (handler)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' }; }
- src/tools/index.ts:40-43 (schema)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'), }),
- src/tools/index.ts:361-372 (registration)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'], }, },
- src/api/repositories.ts:43-46 (helper)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}`); }