Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

list_pull_requests

Retrieve pull requests from a Bitbucket Cloud repository with filtering options to view open, merged, declined, or superseded requests.

Instructions

List pull requests for a repository with optional filtering by state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
stateNoFilter by state
pageNoPage number
pagelenNoResults per page

Implementation Reference

  • Core handler function in PullRequestsAPI that executes the Bitbucket API call to list pull requests for a repository.
    async list(params: ListPullRequestsParams): Promise<PaginatedResponse<BitbucketPullRequest>> {
      const { workspace, repo_slug, ...queryParams } = params;
      return this.client.get<PaginatedResponse<BitbucketPullRequest>>(
        `/repositories/${workspace}/${repo_slug}/pullrequests`,
        queryParams as Record<string, string | number | undefined>
      );
    }
  • Zod schema defining input parameters and validation for the list_pull_requests tool.
    list_pull_requests: z.object({
      workspace: z.string().describe('The workspace slug'),
      repo_slug: z.string().describe('The repository slug'),
      state: z
        .enum(['OPEN', 'MERGED', 'DECLINED', 'SUPERSEDED'])
        .optional()
        .describe('Filter by state'),
      page: z.number().optional().describe('Page number'),
      pagelen: z.number().optional().describe('Results per page'),
    }),
  • Tool registration in the toolDefinitions array, specifying name, description, and input schema for MCP.
    {
      name: 'list_pull_requests',
      description: 'List pull requests for a repository with optional filtering by state.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          workspace: { type: 'string', description: 'The workspace slug' },
          repo_slug: { type: 'string', description: 'The repository slug' },
          state: {
            type: 'string',
            enum: ['OPEN', 'MERGED', 'DECLINED', 'SUPERSEDED'],
            description: 'Filter by state',
          },
          page: { type: 'number', description: 'Page number' },
          pagelen: { type: 'number', description: 'Results per page' },
        },
        required: ['workspace', 'repo_slug'],
      },
    },
  • TypeScript interface defining the parameter types used by the handler.
    export interface ListPullRequestsParams {
      workspace: string;
      repo_slug: string;
      state?: 'OPEN' | 'MERGED' | 'DECLINED' | 'SUPERSEDED';
      page?: number;
      pagelen?: number;
    }
  • Dispatch handler in ToolHandler.handleTool that parses arguments and calls the PullRequestsAPI.list method.
    case 'list_pull_requests': {
      const params = toolSchemas.list_pull_requests.parse(args);
      return this.prs.list(params);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions optional filtering by state but doesn't describe other critical behaviors: whether results are paginated (implied by page/pagelen parameters but not stated), what the return format looks like, rate limits, authentication requirements, or error conditions. For a list operation with 5 parameters, this leaves significant gaps.

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 purpose ('list pull requests for a repository') and adds one key detail ('with optional filtering by state'). There's zero waste or redundancy, making it easy to parse quickly.

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 complexity (5 parameters, no output schema, no annotations), the description is inadequate. It doesn't explain the return format, pagination behavior (despite page/pagelen parameters), error handling, or how it differs from sibling tools. For a list operation in a rich API context, more contextual information is needed to guide proper usage.

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 already documents all 5 parameters thoroughly. The description adds minimal value by mentioning optional state filtering, which is already covered in the schema's enum for the 'state' parameter. No additional parameter context, examples, or constraints beyond the schema are provided, meeting the baseline for high schema coverage.

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 verb ('list') and resource ('pull requests for a repository'), making the purpose immediately understandable. It also mentions optional filtering by state, which adds specificity. However, it doesn't explicitly differentiate from sibling tools like 'get_pull_request' (singular) or 'list_pr_comments', which would have earned a 5.

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 like 'get_pull_request' (for a single PR) or 'list_pr_comments' (for comments on PRs). It mentions optional state filtering but doesn't explain when this filtering is appropriate or what the default behavior is. No prerequisites or context for usage are provided.

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