Skip to main content
Glama

list_repository_branches

Retrieve and display all branches from a specified repository on AtomGit, enabling users to view branch names and manage version control workflows.

Instructions

List branches in a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner, typically referred to as 'username'. Case-insensitive.
repoYesRepository name. Case-insensitive.
per_pageNoNumber of results per page
pageNoPage number

Implementation Reference

  • The main handler function that fetches the list of branches from the AtomGit API using atomGitRequest.
    export async function getBranchList(
      owner: string,
      repo: string,
      page?: number,
      per_page?: number
    ) {
    
      const query = new URLSearchParams();
      if (page) query.append("page", page.toString());
      if (per_page) query.append("per_page", per_page.toString());
    
      return atomGitRequest(
        `https://api.atomgit.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/branches?${query.toString()}`,
        {
          method: "GET",
        }
      );
    }
  • Zod schema defining the input parameters for the list_repository_branches tool.
    export const ListBranchListSchema = z.object({
      owner: z.string().describe("Repository owner, typically referred to as 'username'. Case-insensitive."),
      repo: z.string().describe("Repository name. Case-insensitive."),
      per_page: z.number().describe("Number of results per page").optional(),
      page: z.number().describe("Page number").optional(),
    });
  • index.ts:162-166 (registration)
    Registration of the list_repository_branches tool in the ListTools handler.
    {
      name: "list_repository_branches",
      description: "List branches in a repository",
      inputSchema: zodToJsonSchema(branch.ListBranchListSchema),
    },

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