Skip to main content
Glama
agenticbits

@agenticbits/claude-plugin

by agenticbits

check_repo_branch

Retrieve the current git branch for a repository using its label or path to monitor development status and track active work.

Instructions

Get the current branch for a single repo by its label or path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesRepo label or absolute path

Implementation Reference

  • The implementation of the check_repo_branch tool. It looks up the repository by label or path in the configuration, retrieves the branch information using the getBranchInfo helper, and returns the result.
    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 }] };
      }
    );
  • Registration of the check_repo_branch tool within the registerBranchTools function.
    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 }] };
      }
    );

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/agenticbits/claude-plugin'

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