Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

decline_pull_request

Close a pull request without merging to reject proposed changes in Bitbucket Cloud repositories.

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 tool handler switch case in ToolHandler.handleTool that parses the input arguments using the Zod schema and delegates to PullRequestsAPI.decline to execute the decline action.
    case 'decline_pull_request': { const params = toolSchemas.decline_pull_request.parse(args); return this.prs.decline(params.workspace, params.repo_slug, params.pr_id); }
  • Zod schema definition for input validation of 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 in toolDefinitions array, including name, description, and JSON input schema.
    { 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'], }, },
  • PullRequestsAPI.decline method that makes the Bitbucket API POST request to decline the specified pull request.
    /** * Decline a 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` ); }

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