Skip to main content
Glama
garc33

Bitbucket Server MCP

by garc33

list_projects

Discover and list all accessible Bitbucket projects to explore available options, find project keys, or identify specific projects when keys are unknown.

Instructions

Discover and list all Bitbucket projects you have access to. Use this first to explore available projects, find project keys, or when you need to work with a specific project but don't know its exact key. Returns project keys, names, descriptions and visibility settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of projects to return (default: 25, max: 1000)
startNoStart index for pagination (default: 0)

Implementation Reference

  • Core handler function that executes the list_projects tool: fetches projects from Bitbucket API endpoint '/projects' with pagination (limit, start), processes the response into a summary with project details (key, name, description, public, type), and returns formatted JSON text content.
    private async listProjects(options: ListOptions = {}) {
      const { limit = 25, start = 0 } = options;
      const response = await this.api.get('/projects', {
        params: { limit, start }
      });
    
      const projects = response.data.values || [];
      const summary = {
        total: response.data.size || projects.length,
        showing: projects.length,
        projects: projects.map((project: { key: string; name: string; description?: string; public: boolean; type: string }) => ({
          key: project.key,
          name: project.name,
          description: project.description,
          public: project.public,
          type: project.type
        }))
      };
    
      return {
        content: [{ 
          type: 'text', 
          text: JSON.stringify(summary, null, 2) 
        }]
      };
    }
  • src/index.ts:166-176 (registration)
    Tool registration definition in the ListToolsRequestSchema handler, including name, detailed description, and input schema for pagination parameters.
    {
      name: 'list_projects',
      description: 'Discover and list all Bitbucket projects you have access to. Use this first to explore available projects, find project keys, or when you need to work with a specific project but don\'t know its exact key. Returns project keys, names, descriptions and visibility settings.',
      inputSchema: {
        type: 'object',
        properties: {
          limit: { type: 'number', description: 'Number of projects to return (default: 25, max: 1000)' },
          start: { type: 'number', description: 'Start index for pagination (default: 0)' }
        }
      }
    },
  • Input schema definition for the list_projects tool, specifying optional pagination parameters limit and start.
    inputSchema: {
      type: 'object',
      properties: {
        limit: { type: 'number', description: 'Number of projects to return (default: 25, max: 1000)' },
        start: { type: 'number', description: 'Start index for pagination (default: 0)' }
      }
    }
  • src/index.ts:423-428 (registration)
    Dispatch/registration in the CallToolRequestSchema switch statement that handles tool calls by extracting arguments and invoking the listProjects handler method.
    case 'list_projects': {
      return await this.listProjects({
        limit: args.limit as number,
        start: args.start as number
      });
    }
  • list_projects is listed in the readOnlyTools array, allowing it to be used even in read-only configuration mode.
    const readOnlyTools = ['list_projects', 'list_repositories', 'get_pull_request', 'get_diff', 'get_reviews', 'get_activities', 'get_comments', 'search', 'get_file_content', 'browse_repository'];
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the return format ('Returns project keys, names, descriptions and visibility settings') which is valuable, but doesn't mention authentication requirements, rate limits, error conditions, or pagination behavior beyond what's implied by the parameters. It adequately covers the core behavior but lacks comprehensive operational details.

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 efficiently structured with two sentences that each serve distinct purposes: the first states the core functionality, the second provides usage guidance and return format. There's no wasted language, and key information is front-loaded appropriately.

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

Completeness4/5

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

For a list operation with 2 parameters, 100% schema coverage, and no output schema, the description provides good context about purpose, usage scenarios, and return format. However, without annotations or output schema, it could benefit from more detail about authentication, error handling, or pagination behavior to be fully complete.

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 fully documents both parameters (limit and start). The description doesn't add any parameter-specific information beyond what's in the schema. This meets the baseline expectation when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Discover and list'), resource ('all Bitbucket projects'), and scope ('you have access to'), distinguishing it from sibling tools like list_repositories or search. It provides a comprehensive purpose statement that goes beyond a simple tautology.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool: 'Use this first to explore available projects, find project keys, or when you need to work with a specific project but don't know its exact key.' It provides clear context for usage scenarios, though it doesn't explicitly mention when NOT to use it or name specific alternatives.

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/garc33/bitbucket-server-mcp-server'

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