Skip to main content
Glama

create_branch

Create a new GitLab branch from a branch, tag, or commit. Specify project and branch name; optionally set ref to choose the starting revision.

Instructions

Create a new branch. Use this to create a branch from a branch, tag, or commit; use get_branch or list_branches to inspect branches and protect_branch to configure protection afterward. The operation changes remote repository state, requires branch-creation permission, and returns the new branch or a validation, missing-ref, protected-project, or already-exists error. project_id accepts a numeric ID or URL-encoded path, branch is the new name, and ref selects its starting revision.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoSource branch/commit for new branch
branchYesName for the new branch
jmespathNoOptional JMESPath expression filtering the JSON result before return.
project_idYesProject ID or complete URL-encoded path to project

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv2.1.62
    • changedInput schema / required
      Previous value: -[
      -  "branch",
      -  "project_id"
      -]New value: +[
      +  "project_id",
      +  "branch"
      +]
  3. Addedv2.1.45
  4. Removedv2.1.43
  5. Addedv2.1.18
  6. Removedv2.1.14
  7. Addedv2.1.11
  8. Removedv2.1.10
  9. Changed2 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / required
      Previous value: -[
      -  "branch"
      -]New value: +[
      +  "branch",
      +  "project_id"
      +]
  10. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With only openWorldHint in annotations, the description carries the behavioral disclosure burden. It states the operation changes remote repository state, requires branch-creation permission, and returns the new branch or specific error types (validation, missing-ref, protected-project, already-exists). It does not cover default ref behavior or idempotency, but it is substantially transparent.

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

Conciseness5/5

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

Three dense sentences, front-loaded with the core action, followed by usage routing, behavioral disclosure, and parameter clarifications. No filler or repeated schema text; every sentence earns its place.

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?

Covers what the tool does, when to use it, what can go wrong, and key parameter semantics. Since there is no output schema, explicitly naming the returned new branch or errors is valuable. Minor omissions such as default ref behavior keep it just short of fully complete.

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% for all four parameters, so the baseline is 3. The description adds modest value by clarifying ref can select from a branch, tag, or commit, and that project_id accepts a numeric ID or URL-encoded path, but the jmespath parameter is not mentioned and the schema already documents the properties well.

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 'Create a new branch' with a specific verb and resource, and distinguishes itself from branch-related siblings by naming get_branch/list_branches for inspection and protect_branch for later protection. The scope is clear and an agent can differentiate it without opening schemas.

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

Usage Guidelines5/5

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

Explicitly says 'Use this to create a branch from a branch, tag, or commit' and points to get_branch/list_branches for inspection and protect_branch for configuring protection. This gives concrete routing guidance and clarifies when to choose this tool over relevant alternatives.

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

Deploy Server

Other Tools