Skip to main content
Glama

merjax_set_branch_protection

Idempotent

Set branch protection for one branch (partial update: fields you omit keep their value). Edits the rule named exactly after the branch; when only a glob rule covers it, a new exact rule is created seeded from the glob's settings and checks. required_checks replaces the required-check list; it may add checks, but REMOVING a check that applies to the branch is refused here (it needs a step-up: the web page or the REST API with the account password). require_pr_run: a required check that names a workflow is met only by that workflow's pull_request run. Requires ADMIN access to the repo and 'repo' scope. Audit-logged. Returns the resulting rule plus {created, warnings}.

Input Schema

NameRequiredDescriptionDefault
repoYesRepo name
ownerYesRepo owner — username or organisation slug
branchYesBranch name (not a pattern)
allow_deletionNo
require_pr_runNoWorkflow checks count only from the PR's pull_request run
required_checksNoArray of check names that must pass (workflow names, gate names or commit-status contexts); [] clears the list
allow_force_pushNo
enable_auto_mergeNoBranch-wide autopilot auto-merge (K2)
required_approvalsNoHuman approvals required (0-10)
require_ai_approvalNo
require_green_gatesNo
require_human_reviewNo
require_pull_requestNo
dismiss_stale_reviewsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only say it is a non-read-only, idempotent, non-destructive mutation; the description goes well beyond that by naming the ADMIN access and 'repo' scope requirement, disclosing audit logging, describing the glob-to-exact-rule seeding behavior, and calling out the specific refusal condition for check removal. It also states the return payload, which matters because there is no output schema.

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 and mutation semantics, and nearly every clause carries information an agent needs. It is a dense single paragraph, though, so the caveat about check removal and the return shape would scan better as separate sentences or bullets.

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

Completeness4/5

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

For a 14-parameter mutation with no output schema, it covers the high-risk areas: permissions, audit trail, rule creation side effect, non-reversible check removal, and the returned rule plus {created, warnings}. What it omits is the meaning of the simpler boolean flags, which an agent must infer from their names.

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 50%, and the description adds real meaning for two parameters — required_checks (replace semantics, [] clears, removals refused) and require_pr_run (workflow-named checks only satisfied by that workflow's pull_request run). The other seven undocumented booleans such as allow_force_push, allow_deletion, require_green_gates, require_ai_approval and dismiss_stale_reviews get no explanation in either place, so it only partly compensates.

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?

Opens with a specific verb+resource ('Set branch protection for one branch') and immediately qualifies the operation as a partial update, which distinguishes it from a full-replace sibling. It further clarifies that it edits the exact-named rule and creates one when only a glob rule covers the branch, so an agent understands both the target and the side effect 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 operating context: omitted fields keep their value, required_checks replaces rather than merges, and removal of an applicable check is refused here with the alternatives named (web page or REST API with the account password). It does not explicitly point to merjax_get_branch_protection as the read counterpart, which is the only notable gap.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources