Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

list_issues

Retrieve and filter issues from a Bitbucket Cloud repository to track bugs, tasks, and feature requests. Use query parameters to sort results and control pagination.

Instructions

List issues in a repository with optional filtering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
qNoQuery string for filtering
sortNoSort field
pageNoPage number
pagelenNoResults per page

Implementation Reference

  • Registration of the 'list_issues' tool in the toolDefinitions array for MCP, including name, description, and JSON schema for inputs.
    {
      name: 'list_issues',
      description: 'List issues in a repository with optional filtering.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          workspace: { type: 'string', description: 'The workspace slug' },
          repo_slug: { type: 'string', description: 'The repository slug' },
          q: { type: 'string', description: 'Query string for filtering' },
          sort: { type: 'string', description: 'Sort field' },
          page: { type: 'number', description: 'Page number' },
          pagelen: { type: 'number', description: 'Results per page' },
        },
        required: ['workspace', 'repo_slug'],
      },
    },
  • Zod schema definition for validating inputs to the list_issues tool.
    list_issues: z.object({
      workspace: z.string().describe('The workspace slug'),
      repo_slug: z.string().describe('The repository slug'),
      q: z.string().optional().describe('Query string for filtering'),
      sort: z.string().optional().describe('Sort field'),
      page: z.number().optional().describe('Page number'),
      pagelen: z.number().optional().describe('Results per page'),
    }),
  • ToolHandler switch case that handles the 'list_issues' tool call: parses arguments with Zod schema and delegates to IssuesAPI.list method.
    case 'list_issues': {
      const params = toolSchemas.list_issues.parse(args);
      return this.issues.list(params);
    }
  • Core implementation of listing issues: makes a GET request to Bitbucket API endpoint /repositories/{workspace}/{repo_slug}/issues with query parameters.
    async list(params: ListIssuesParams): Promise<PaginatedResponse<BitbucketIssue>> {
      const { workspace, repo_slug, ...queryParams } = params;
      return this.client.get<PaginatedResponse<BitbucketIssue>>(
        `/repositories/${workspace}/${repo_slug}/issues`,
        queryParams as Record<string, string | number | undefined>
      );
    }
  • TypeScript interface defining the parameters for listing issues, used in IssuesAPI.list.
    export interface ListIssuesParams {
      workspace: string;
      repo_slug: string;
      q?: string;
      sort?: string;
      page?: number;
      pagelen?: number;
    }

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