Skip to main content
Glama
RajuSudhar

Atlassian Bitbucket MCP Server

by RajuSudhar

bitbucket_get_pull_request

Retrieve detailed pull request information from a Bitbucket repository by providing project key, repository slug, and pull request ID.

Instructions

Get detailed pull request information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject key
repoYesRepository slug
prIdYesPull request ID

Implementation Reference

  • The handler function for 'bitbucket_get_pull_request'. It parses args using prRefShape (project, repo, prId), checks 'read_pr' permission, calls prApi.get(), and returns the PullRequest data.
    bitbucket_get_pull_request: async (args: unknown): Promise<McpToolResult> => {
      const start = Date.now();
      try {
        const input = z.object(prRefShape).parse(args);
        requirePermission(config, 'read_pr');
        log('info', 'tool start', {
          operation: 'tool_execute',
          toolName: 'bitbucket_get_pull_request',
        });
        const result = await prApi.get(input.project, input.repo, input.prId);
        log('info', 'tool end', {
          toolName: 'bitbucket_get_pull_request',
          durationMs: Date.now() - start,
        });
        return textResult(result);
      } catch (err) {
        log('error', 'tool error', {
          toolName: 'bitbucket_get_pull_request',
          error: String(err),
          durationMs: Date.now() - start,
        });
        return errorResult('GET_PR_FAILED', err instanceof Error ? err.message : String(err));
      }
    },
  • Input schema prRefShape for the tool, defining required fields: project (string), repo (string), and prId (positive integer).
    export const prRefShape = { project, repo, prId } as const;
  • Registration entry pairing tool name 'bitbucket_get_pull_request' with description, prRefShape schema, and handler reference h.pr.bitbucket_get_pull_request.
    {
      name: 'bitbucket_get_pull_request',
      description: 'Get detailed pull request information',
      shape: prRefShape,
      handler: h.pr.bitbucket_get_pull_request,
    },
  • PullRequestApi.get() method called by the handler. Makes a GET request to /projects/{project}/repos/{repo}/pull-requests/{prId} and returns a PullRequest response.
    async get(project: string, repo: string, prId: number): Promise<PullRequest> {
      return this.client.requestJson<PullRequest>(
        `/projects/${project}/repos/${repo}/pull-requests/${prId}`
      );
    }
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It only states 'Get detailed pull request information', omitting whether it includes comments, diffs, approvals, or other attributes. The lack of detail hinders the agent's understanding of what 'detailed' covers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with a single sentence. It is front-loaded with the key action and resource. While it could add value with more details, it avoids unnecessary verbosity.

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

Completeness3/5

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

Given the simplicity of the tool (retrieve a PR by ID) and the lack of an output schema, the description is minimal but adequate. It does not describe return format or additional fields, but the expected output is implicit for a typical PR retrieval. Slightly below complete for a new 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?

The input schema has 100% coverage with descriptive parameter names (project, repo, prId) and descriptions. The description adds no additional meaning beyond what the schema already provides, resulting in a baseline score of 3.

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 'Get detailed pull request information' clearly specifies the verb 'Get' and resource 'pull request information'. It distinguishes from siblings like bitbucket_list_pull_requests (listing vs single) and bitbucket_approve_pr (action vs read). However, it could be more precise about what 'detailed' entails.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: use this to retrieve details of a specific pull request, as opposed to listing PRs or performing actions. No explicit when/when-not guidance or alternatives are provided, leaving the agent to infer from sibling context.

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/RajuSudhar/atlassian-bitbucket-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server