Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

get_file_content

Retrieve file contents from Bitbucket repositories to access code, documentation, or configuration files for review, analysis, or integration purposes.

Instructions

Get the content of a file from a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
pathYesThe file path
refNoThe reference (branch, tag, or commit hash) - defaults to HEAD

Implementation Reference

  • The implementation of the getFileContent method in the BitbucketClient class, which makes the API call to Bitbucket to retrieve file content.
    async getFileContent(workspace: string, repoSlug: string, path: string, ref?: string): Promise<string> {
      const params = ref ? { ref } : {};
      const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/src/${ref || 'HEAD'}/${path}`, { params });
      return response.data;
    }
  • The MCP tool request handler case for get_file_content, which extracts arguments from the request and calls the BitbucketClient's getFileContent method.
    case 'get_file_content': {
      const { workspace, repo_slug, path, ref } = args as {
        workspace: string;
        repo_slug: string;
        path: string;
        ref?: string;
      };
      const content = await client.getFileContent(workspace, repo_slug, path, ref);
      return {
        content: [
          {
            type: 'text',
            text: content,
          },
        ],
      };
    }
  • The tool definition/schema for get_file_content, describing its inputs and purpose.
      name: 'get_file_content',
      description: 'Get the content of a file from a repository',
      inputSchema: {
        type: 'object',
        properties: {
          workspace: {
            type: 'string',
            description: 'The workspace slug',
          },
          repo_slug: {
            type: 'string',
            description: 'The repository slug',
          },
          path: {
            type: 'string',
            description: 'The file path',
          },
          ref: {
            type: 'string',
            description: 'The reference (branch, tag, or commit hash) - defaults to HEAD',
          },
        },
        required: ['workspace', 'repo_slug', 'path'],
      },
    },
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 states the action but lacks details on permissions, rate limits, error handling, or output format. This is insufficient for a tool that likely involves network calls and file access, leaving key behavioral traits undefined.

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 directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it highly concise and well-structured for quick comprehension.

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 of file retrieval from a repository, with no annotations and no output schema, the description is incomplete. It does not cover behavioral aspects like authentication needs, error cases, or return value format, leaving significant gaps for the agent to operate effectively.

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 fully documents all parameters. The description adds no additional meaning beyond implying a file content retrieval context, which aligns with the schema but does not enhance parameter understanding. Baseline 3 is appropriate as the schema handles the heavy lifting.

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 'Get' and the resource 'content of a file from a repository', making the purpose specific and understandable. However, it does not explicitly differentiate from siblings like 'get_commit' or 'search_code', which might also retrieve file-related data, so it misses full distinction.

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. For example, it does not mention if this is for raw file content retrieval versus metadata or search operations, leaving the agent to infer usage from context without explicit direction.

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

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