Skip to main content
Glama

Git Rebase

git_rebase

Rebase branches onto upstream commits to create linear project history. Reapplies commits on new base tips with options for interactive mode and merge preservation.

Instructions

Rebase commits onto another branch. Reapplies commits on top of another base tip for a cleaner history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to the Git repository. Defaults to session working directory set via git_set_working_dir..
modeNoRebase operation mode: 'start', 'continue', 'abort', or 'skip'.start
upstreamNoUpstream branch to rebase onto (required for start mode).
branchNoBranch to rebase (default: current branch).
interactiveNoInteractive rebase (not supported in all providers).
ontoNoRebase onto different commit than upstream.
preserveNoPreserve merge commits during rebase.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successYesIndicates if the operation was successful.
conflictsYesWhether rebase had conflicts.
conflictedFilesYesFiles with conflicts that need resolution.
rebasedCommitsYesNumber of commits that were rebased.
currentCommitNoCurrent commit hash if rebase stopped due to conflict.
Behavior3/5

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

Annotations declare readOnlyHint=false (mutative), and the description adds that commits are 'reapplied' and history becomes 'cleaner,' which hints at rewriting. However, it omits key behavioral traits: that commit hashes change, that conflicts may require manual resolution, or that this is a destructive history rewrite.

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?

Two sentences efficiently structured: first defines the action, second explains the mechanism and value proposition. No redundant or wasted words.

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?

Given the 100% schema coverage and existence of an output schema, the description adequately covers the basics. However, for a complex stateful git operation with conflict potential, the description is minimal—it fails to prepare the agent for the multi-step process or explain what happens in the output schema (likely rebase progress/conflict status).

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?

With 100% schema description coverage, the baseline is 3. The description mentions 'onto another branch' which loosely references the upstream/onto parameters, but adds no syntax clarification, examples, or explanations of the stateful mode workflow (start/continue/abort/skip) beyond what the schema enum already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reapplies commits onto another base for a cleaner history, using specific verbs (rebase, reapplies). The 'cleaner history' phrase implicitly distinguishes it from git_merge (which creates merge commits), though it could explicitly mention the linear history advantage.

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?

No guidance is provided on when to choose rebase over merge (sibling tool), nor warnings about rebasing public/shared branches. The description lacks prerequisites (e.g., clean working directory) and doesn't explain the multi-step workflow implied by the mode parameter (start/continue/abort).

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/cyanheads/git-mcp-server'

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