Skip to main content
Glama

List branch protections

list_branch_protections
Read-only

Lists a repository's branch protection rules by owner/repo, showing required approvals, status checks, signed commits, and whether direct pushes are allowed so you can verify branch enforcement.

Instructions

List a repository's branch protection rules (owner/repo). Shows what each rule enforces — require_signed_commits, whether direct pushes are allowed, required approvals, status checks — for a branch name or glob. A branch matching no rule is unprotected, so an empty list means nothing is protected rather than a missing feature. require_signed_commits rejects pushes that are unsigned OR unverifiable, and is checked against the commits a push introduces rather than the branch's history, so enabling it does not invalidate what is already there. Allowlists of usernames, teams and deploy keys are omitted: they answer who may bypass a gate, not what is enforced. enable_force_push is Gitea-only and apply_to_admins Forgejo-only — absent means the forge does not report it, not false.

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name.
ownerYesRepository owner — user or organization.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.22.0

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint, so the description carries real weight and delivers: empty list semantics (nothing protected vs. feature absent), the fact that require_signed_commits is evaluated against introduced commits rather than branch history, what data is deliberately omitted, and that enable_force_push/apply_to_admins are forge-specific with 'absent ≠ false'. That is genuinely non-obvious behavior an agent could otherwise misread.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the purpose, then layered detail. It is long for a two-parameter read tool, but with no output schema most of the length is load-bearing. The 'for a branch name or glob' clause is the one sentence that doesn't cleanly earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description must convey what comes back — and it does, enumerating enforced fields (signed commits, direct pushes, required approvals, status checks) plus explicit caveats about omitted and forge-specific fields. An agent has enough to interpret results correctly, including the ambiguous empty-list case.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with only owner/repo documented, so the baseline applies. The description adds the '(owner/repo)' hint but then mentions 'a branch name or glob' as if it were an input, when no such parameter exists in the schema — a mild source of confusion rather than added meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('List a repository's branch protection rules') and scopes it to owner/repo, which cleanly separates it from list_branches and get_repo in the sibling set. An agent knows exactly what this returns before opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explains the question the tool answers ('what each rule enforces') and explicitly disclaims bypass/allowlist data, effectively routing that need elsewhere. Missing is an explicit statement of when to use this versus inspecting branch metadata via list_branches, but the operational context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.