Skip to main content
Glama

create_branch_restriction

Create branch protection rules in Bitbucket to restrict pushes, merges, deletions, or enforce requirements like CI passes and approvals.

Instructions

Create a branch restriction (protection rule).

Args:
    repo_slug: Repository slug
    kind: Type of restriction. Common values:
          - "push" - Restrict who can push
          - "force" - Restrict force push
          - "delete" - Restrict branch deletion
          - "restrict_merges" - Restrict who can merge
          - "require_passing_builds_to_merge" - Require CI to pass
          - "require_approvals_to_merge" - Require PR approvals
          - "require_default_reviewer_approvals_to_merge"
          - "require_no_changes_requested"
          - "require_tasks_to_be_completed"
    pattern: Branch pattern (e.g., "main", "release/*"). Required for glob match.
    branch_match_kind: How to match branches - "glob" (pattern) or "branching_model" (development/production)
    branch_type: Branch type when using branching_model - "development", "production", or specific category
    value: Numeric value for restrictions that need it (e.g., number of required approvals)

Returns:
    Created restriction info with ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_slugYes
kindYes
patternNo
branch_match_kindNoglob
branch_typeNo
valueNo
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it states this is a creation operation (implying mutation), it doesn't mention permission requirements, whether the operation is idempotent, what happens on conflicts, or any rate limits. The description provides basic functional information but lacks critical behavioral context for a mutation tool.

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?

The description is well-structured with clear sections (Args, Returns) and uses bullet points effectively for the 'kind' parameter. While comprehensive, it maintains efficiency - every sentence adds value. The front-loaded purpose statement is clear, though the parameter explanations are necessarily detailed given the complexity.

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

Completeness3/5

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

For a 6-parameter mutation tool with no annotations and no output schema, the description provides good parameter semantics but lacks behavioral context and usage guidance. The return statement is minimal ('Created restriction info with ID'), leaving the agent uncertain about the response format. While parameters are well-documented, other aspects remain incomplete.

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

Parameters5/5

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

With 0% schema description coverage, the description compensates excellently by explaining all 6 parameters in detail. It provides semantic meaning for 'kind' with common values and examples, clarifies 'pattern' usage with examples, explains the relationship between 'branch_match_kind' and 'branch_type', and specifies when 'value' is needed. This adds substantial value beyond the bare schema.

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?

The description clearly states the specific action ('Create a branch restriction/protection rule') and resource ('branch restriction'), distinguishing it from sibling tools like 'delete_branch_restriction' or 'list_branch_restrictions'. It provides a precise verb+resource combination that leaves no ambiguity about the tool's function.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. While it's clear this creates restrictions (unlike 'delete_branch_restriction' which removes them), there's no mention of prerequisites, when this should be applied, or how it relates to other repository management tools in the sibling list. The agent receives no contextual usage advice.

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

Install Server

Other Tools

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/JaviMaligno/mcp-server-bitbucket'

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