Skip to main content
Glama

get_repository_branch_details

Retrieve specific branch information including commit details, protection rules, and status from AtomGit repositories to manage code collaboration and deployment workflows.

Instructions

Get details of a specific branch in a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner, typically referred to as 'username'. Case-insensitive.
repoYesRepository name. Case-insensitive.
branchYesBranch name, cannot contain wildcards.

Implementation Reference

  • The core handler function that performs the HTTP request to AtomGit API to retrieve specific branch details.
    /**
     * Retrieves details of a branch.
     * @param owner - Repository owner
     * @param repo - Repository name
     * @param branch - Branch name
     */
    export async function getBranchDetail(
      owner: string,
      repo: string,
      branch: string
    ) {
    
    
      return atomGitRequest(
        `https://api.atomgit.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/branches/${encodeURIComponent(branch)}`,
        {
          method: "GET",
        }
      );
    }
  • Zod schema defining the input parameters for the get_repository_branch_details tool.
    export const ListBranchDetailSchema = z.object({
      owner: z.string().describe("Repository owner, typically referred to as 'username'. Case-insensitive."),
      repo: z.string().describe("Repository name. Case-insensitive."),
      branch: z.string().describe("Branch name, cannot contain wildcards."),
    });
  • index.ts:167-171 (registration)
    Registration of the tool in the MCP server's list of tools, including schema reference.
    {
      name: "get_repository_branch_details",
      description: "Get details of a specific branch in a repository",
      inputSchema: zodToJsonSchema(branch.ListBranchDetailSchema),
    },
  • Dispatcher case in the main request handler that parses args and calls the branch handler.
    case "get_repository_branch_details": {
      const args = branch.ListBranchDetailSchema.parse(request.params.arguments);
      const result = await branch.getBranchDetail(args.owner, args.repo, args.branch);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }

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/kaiyuanxiaobing/atomgit-mcp-server'

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