Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

get_pr_diff

Retrieve the complete diff showing all changes in a Bitbucket Cloud pull request to review modifications before merging.

Instructions

Get the diff for a pull request showing all changes.

Input Schema

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

Implementation Reference

  • The handler case for the 'get_pr_diff' tool in the ToolHandler class's handleTool method. It parses the input arguments using the schema, calls the PullRequestsAPI.getDiff method to fetch the pull request diff, and returns it wrapped in an object.
    case 'get_pr_diff': {
      const params = toolSchemas.get_pr_diff.parse(args);
      const diff = await this.prs.getDiff(params.workspace, params.repo_slug, params.pr_id);
      return { diff };
    }
  • Zod schema definition for the input parameters of the 'get_pr_diff' tool, part of the toolSchemas object.
    get_pr_diff: 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'),
    }),
  • Tool registration definition in the toolDefinitions array for MCP protocol, specifying the name, description, and JSON schema for input validation.
    {
      name: 'get_pr_diff',
      description: 'Get the diff for a pull request showing all changes.',
      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?

With no annotations provided, the description carries full burden but offers minimal behavioral disclosure. It mentions the output shows 'all changes', hinting at comprehensiveness, but lacks details on format, size limits, pagination, authentication needs, or error conditions. For a read operation with zero annotation coverage, this is insufficient.

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 with zero waste. It's front-loaded with the core purpose and avoids unnecessary elaboration. Every word contributes directly to understanding the tool's function.

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?

For a tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It lacks behavioral context, usage guidance, and details on output format or limitations. While concise, it doesn't compensate for the missing structured information, leaving significant gaps for an AI agent.

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 parameters are fully documented in the schema. The description adds no additional parameter semantics beyond implying the tool operates on a pull request, which is already clear from the parameter names. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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 ('Get the diff') and resource ('for a pull request'), specifying it shows 'all changes'. It distinguishes from siblings like 'get_commit_diff' by focusing on pull requests, but doesn't explicitly differentiate from similar tools like 'get_pull_request' which might also provide diff information.

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?

No guidance on when to use this tool versus alternatives is provided. It doesn't mention prerequisites, when not to use it, or compare with siblings like 'get_pull_request' or 'get_commit_diff'. The description only states what it does without contextual usage information.

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