Skip to main content
Glama
bitbucket-mcp

bitbucket-mcp

by nevzatcirak

Get pull request diff

bb_get_pull_request_diff

Fetches a pull request diff, optionally limited to one file, with compact previews, added/removed line counts, and omission stats to keep review context within limits.

Instructions

Fetch the diff of a pull request (optionally for one file). Each file is compacted with smart truncation: head 60% + tail 40% of the preview budget, plus added/removed line counts and omission statistics.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectKey": "<projectKey>",
      "repositorySlug": "<repositorySlug>",
      "pullRequestId": "<pullRequestId>"
    },
    "name": "bb_get_pull_request_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoLimit the diff to this file path.
projectKeyYesProject key (on Cloud: workspace slug).
pullRequestIdYesPull request id, e.g. 101.
repositorySlugYesRepository slug, e.g. 'service-api'.
maxCharsPerFileNoPreview budget per file (head 60% / tail 40% on truncation).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden, and it discloses the most important behavioral risk: output is compacted via truncation (head 60% / tail 40% of a per-file budget) and reports added/removed line counts plus omission statistics, so an agent knows returned diffs may be incomplete. It omits other behavior such as permission requirements or error conditions, but the truncation disclosure is substantive value beyond any structured field.

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?

Two sentences with zero filler; the core action is front-loaded and the truncation mechanics follow as supporting detail. Every clause carries information an agent would otherwise have to guess.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description compensates by explaining the shape of the return (per-file compacted preview, line counts, omission stats) plus the budget control that shapes it. Only permission/error behavior is left uncovered, which is a modest gap for a read operation.

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 baseline is 3. The description reinforces semantics for two parameters — per-file scoping (path) and the preview budget (maxCharsPerFile) with its 60/40 split — but adds no format details, path syntax, or constraints beyond what the schema already documents.

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?

States a specific verb and resource ('Fetch the diff of a pull request') plus a scoping modifier ('optionally for one file'). It does not, however, contrast itself with the nearby bb_get_pull_request_changes sibling, so an agent must infer the difference between 'diff' and 'changes' from the names alone.

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 parenthetical 'optionally for one file' hints that a per-file fetch is possible, but there is no explicit when-to-use guidance, no statement of when to prefer this over bb_get_pull_request_changes or bb_get_file_content, and no prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.