Skip to main content
Glama

Create branch from exact commit

gh_create_branch_from_sha

Create a new branch at an exact commit SHA without overwriting existing branches. Verifies the ref after creation, leaving conflicts unchanged.

Instructions

Additive write: create exactly one new branch at an exact 40-character commit SHA after ordinary write authorization. A branch already at the requested SHA is a safe no-write result; a conflicting existing branch is left unchanged. One mutation attempt is followed by authoritative exact-ref readback; the operation never force-updates, moves, overwrites, deletes, or blindly retries an ambiguous ref creation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNew branch name.
repoYesGitHub repository name without the owner prefix.
ownerYesGitHub repository owner or organization login.
base_shaYesExact commit SHA at which to create the new branch.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYes
nameYes
createdYes
messageYes
warningNo
base_shaYes
request_idNo
write_completedYes
readback_completedYes
precondition_checkedYes
state_matches_requestedYes
Behavior4/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, but the description adds critical behavioral details: it is additive, never force-updates or overwrites, handles pre-existing branch cases safely (no-write if same SHA, leaves conflicts unchanged), and performs an exact-ref readback after mutation. This significantly extends beyond the annotations, revealing side effects and safety guarantees.

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?

The description is a single, information-dense sentence that front-loads the key purpose and then enumerates safety behaviors. Every clause adds essential context without waste. It is concise yet comprehensive, achieving high value per word.

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?

The tool has moderate complexity (4 parameters, 100% schema coverage, output schema exists) and the description covers the key mutation semantics, edge cases, and verification behavior. It does not explain the return value format, but the output schema likely covers that. It could mention permission requirements, but the 'ordinary write authorization' hint is present. Generally complete for the complexity level.

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?

The schema has 100% coverage with clear descriptions for each parameter (e.g., 'New branch name', 'GitHub repository name without owner prefix', 'Exact commit SHA'). The description itself does not add new parameter details beyond the schema, but the schema already provides sufficient meaning. Baseline 3 is appropriate as the schema does the heavy lifting.

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 states the specific verb 'create' and the resource ('exactly one new branch at an exact 40-character commit SHA'), which distinguishes it from the sibling tool 'gh_create_branch' likely used for branches at other refs. It precisely defines the operation scope and behavior.

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?

The description clearly implies the tool is for creating branches at a specific commit SHA, and the sibling 'gh_create_branch' suggests a general branch creation tool. It explains behavior when branch already exists or conflicts, but does not explicitly say 'use this when you need to create a branch at a specific SHA' or contrast with alternatives. Adequate context but no explicit exclusions.

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/fvanevski/gh_mcp'

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