Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

get_pr_diff

Retrieve the complete diff for a Bitbucket Cloud pull request to review all code changes 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

  • Handler case in ToolHandler.handleTool for the 'get_pr_diff' tool. Parses arguments using Zod schema and calls PullRequestsAPI.getDiff to retrieve the pull request diff.
    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 input schema definition for the 'get_pr_diff' tool used for validation in the handler.
    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 toolDefinitions array for MCP, including name, description, and JSON input schema.
    { 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'], }, },
  • Supporting method in PullRequestsAPI class that performs the actual API call to retrieve the pull request diff from Bitbucket.
    async getDiff(workspace: string, repo_slug: string, pr_id: number): Promise<string> { return this.client.getRaw(`/repositories/${workspace}/${repo_slug}/pullrequests/${pr_id}/diff`); }

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