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
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner, typically referred to as 'username'. Case-insensitive. | |
| repo | Yes | Repository name. Case-insensitive. | |
| per_page | No | Number of results per page | |
| page | No | Page number |
Implementation Reference
- operations/branch.ts:24-41 (handler)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", } ); }
- operations/branch.ts:4-9 (schema)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), },