Skip to main content
Glama

Branch Protection Status

branch_protection_status
Read-onlyIdempotent

Inspect a GitHub branch's protection settings and rulesets to verify required reviews, status checks, force-push and deletion rules, returning findings and a protection verdict.

Instructions

Read classic branch protection AND repository rulesets for a branch (defaults to the repo's default branch).

Required token scope: repo (or public_repo for public-only repos) with admin/read access to branch protection.

Args:

  • owner, repo: Repository coordinates.

  • branch: Optional. Falls back to the repository's default branch.

Returns: Required reviews / status checks / force-push / deletion settings from both classic protection and rulesets, findings by severity, verification gaps, and a protected/partially_protected/unprotected/unknown conclusion.

Input Schema

NameRequiredDescriptionDefault
repoNoGitHub repo. Falls back to GITHUB_REPO.
ownerNoGitHub owner. Falls back to GITHUB_OWNER.
branchNoBranch to inspect. Falls back to the repository's default branch.

Output Schema

NameRequiredDescriptionDefault
repoYes
branchYes
errorsYes
findingsYes
conclusionYes
enforceAdminsYes
trustBoundaryNo
allowDeletionsYes
allowForcePushesYes
rulesetRuleTypesYes
rulesetsVerifiedYes
verificationGapsYes
requireCodeOwnerReviewsYes
classicProtectionEnabledYes
classicProtectionVerifiedYes
requiredStatusCheckContextsYes
requiredApprovingReviewCountYes
requiredConversationResolutionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.11.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed6 schema fields changedv1.9.0
    • addedOutput schema / properties / classicProtectionVerified
      Added value: +{
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / conclusion / enum
      Previous value: -[
      -  "protected",
      -  "partially_protected",
      -  "unprotected"
      -]New value: +[
      +  "protected",
      +  "partially_protected",
      +  "unprotected",
      +  "unknown"
      +]
    • addedOutput schema / properties / rulesetsVerified
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / trustBoundary
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "callerAndRepositoryContent": {
      +      "const": "untrusted",
      +      "type": "string"
      +    },
      +    "instructionHandling": {
      +      "const": "never_execute",
      +      "type": "string"
      +    },
      +    "permissionHandling": {
      +      "const": "never_expand",
      +      "type": "string"
      +    },
      +    "secretHandling": {
      +      "const": "never_reveal",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "callerAndRepositoryContent",
      +    "instructionHandling",
      +    "secretHandling",
      +    "permissionHandling"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / verificationGaps
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "repo",
      -  "branch",
      -  "classicProtectionEnabled",
      -  "requiredApprovingReviewCount",
      -  "requireCodeOwnerReviews",
      -  "requiredStatusCheckContexts",
      -  "enforceAdmins",
      -  "allowForcePushes",
      -  "allowDeletions",
      -  "requiredConversationResolution",
      -  "rulesetRuleTypes",
      -  "findings",
      -  "errors",
      -  "conclusion"
      -]New value: +[
      +  "repo",
      +  "branch",
      +  "classicProtectionEnabled",
      +  "requiredApprovingReviewCount",
      +  "requireCodeOwnerReviews",
      +  "requiredStatusCheckContexts",
      +  "enforceAdmins",
      +  "allowForcePushes",
      +  "allowDeletions",
      +  "requiredConversationResolution",
      +  "rulesetRuleTypes",
      +  "classicProtectionVerified",
      +  "rulesetsVerified",
      +  "verificationGaps",
      +  "findings",
      +  "errors",
      +  "conclusion"
      +]
  3. First observedv1.5.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/destructiveHint=false, so the safety profile is covered. The description adds genuinely useful context beyond that: the required token scope ('repo'/'public_repo' with admin/read access) and that it merges two sources (classic protection and rulesets) with severity and verification-gap findings.

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 purpose, then token scope, then Args/Returns in a scannable layout. The Args section mildly duplicates the schema, but the structure is efficient and nothing is wasted.

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?

Complete for this tool: an output schema exists so return values need not be enumerated, yet the description usefully summarizes the conclusion categories. Auth requirements, default behavior, and data sources are all covered.

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 description coverage is 100%, so all three parameters are already documented in the schema. The description restates the owner/repo coordinates and the branch default-branch fallback, adding no format or syntax detail beyond what the schema provides. Baseline 3 is appropriate.

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 ('Read') and resource ('classic branch protection AND repository rulesets for a branch'), and the dual-source scope distinguishes it from siblings like workflow_permissions_audit or quality_gate_status. An agent can tell what this tool retrieves without 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?

Gives clear context: it reads protection for a branch and defaults to the repo's default branch when the branch arg is omitted. It also states the required token scope, which informs eligibility. However, it never names alternative tools or says when NOT to use this one.

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