check_repo_branch
Retrieve the current git branch for a repository using its label or path. This tool helps developers track active branches within the Agentic Bits Claude Plugin.
Instructions
Get the current branch for a single repo by its label or path.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"identifier": "<identifier>"
},
"name": "check_repo_branch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| identifier | Yes | Repo label or absolute path |
Implementation Reference
- src/tools/branches.ts:54-71 (handler)The handler and registration for the check_repo_branch tool.
// --- check_repo_branch --- server.tool( "check_repo_branch", "Get the current branch for a single repo by its label or path.", { identifier: z.string().describe("Repo label or absolute path") }, async ({ identifier }) => { const config = loadConfig(); const repo = config.repos.find((r) => r.label === identifier || r.path === identifier); if (!repo) { return { content: [{ type: "text", text: `No repo found matching "${identifier}". Use list_repos to see all configured repos.` }] }; } const info = getBranchInfo(repo); const text = info.error ? `${info.label}: ERROR — ${info.error}` : `${info.label}: ${info.branch ?? "HEAD detached"}`; return { content: [{ type: "text", text }] }; } );