Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

decline_pull_request

Decline or close a pull request without merging it in Bitbucket Cloud repositories. Use this tool to reject changes that don't meet requirements or need revision.

Instructions

Decline/close a pull request without merging.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
pr_idYesThe pull request ID

Implementation Reference

  • The main handler logic for the 'decline_pull_request' tool within ToolHandler.handleTool method. It validates input using Zod schema and calls the PullRequestsAPI.decline method.
    case 'decline_pull_request': { const params = toolSchemas.decline_pull_request.parse(args); return this.prs.decline(params.workspace, params.repo_slug, params.pr_id); }
  • The supporting API method in PullRequestsAPI that executes the Bitbucket API POST request to decline the specified pull request.
    async decline( workspace: string, repo_slug: string, pr_id: number ): Promise<BitbucketPullRequest> { return this.client.post<BitbucketPullRequest>( `/repositories/${workspace}/${repo_slug}/pullrequests/${pr_id}/decline` ); }
  • Zod input schema definition for the 'decline_pull_request' tool parameters.
    decline_pull_request: z.object({ workspace: z.string().describe('The workspace slug'), repo_slug: z.string().describe('The repository slug'), pr_id: z.number().describe('The pull request ID'), }),
  • MCP tool registration entry including name, description, and JSON Schema for input validation.
    { name: 'decline_pull_request', description: 'Decline/close a pull request without merging.', inputSchema: { type: 'object' as const, properties: { workspace: { type: 'string', description: 'The workspace slug' }, repo_slug: { type: 'string', description: 'The repository slug' }, pr_id: { type: 'number', description: 'The pull request ID' }, }, required: ['workspace', 'repo_slug', 'pr_id'], }, },

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