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'],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool performs a decline/close action, implying a destructive mutation, but doesn't disclose critical behavioral traits: whether this is reversible, what permissions are required, if it sends notifications, or what happens to associated branches. For a mutation tool with zero annotation coverage, this is inadequate.

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, efficient sentence that front-loads the core action and outcome. Every word earns its place: 'Decline/close' specifies the action, 'a pull request' identifies the resource, and 'without merging' clarifies the distinction from merging. No wasted words or redundancy.

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?

Given the tool's complexity (a destructive mutation on a pull request), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral implications, error conditions, or return values. For a tool that permanently alters PR state, more context on effects and requirements is needed.

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 three parameters (workspace, repo_slug, pr_id). The description adds no parameter-specific information beyond what the schema provides—it doesn't explain parameter relationships or usage context. Baseline 3 is appropriate when the schema does all the work.

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 ('Decline/close') and resource ('a pull request') with the specific outcome 'without merging'. It distinguishes from sibling tools like 'merge_pull_request' by explicitly excluding merging, but doesn't differentiate from other PR modification tools like 'update_pull_request' or 'request_changes' beyond the decline action.

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., user permissions), typical scenarios for declining vs. merging, or how it differs from simply closing a PR through other means. With multiple PR-related siblings (merge_pull_request, update_pull_request, request_changes), this lack of context is a significant gap.

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

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