Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

git_rebase

Reapply commits from your current branch onto another branch to maintain a linear project history and integrate changes without merge commits.

Instructions

Reapply commits on top of another branch

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNoBranch to rebase onto
cwdNoRepository directory
interactiveNoInteractive rebase (not supported)
abortNoAbort current rebase
continueNoContinue rebase after resolving conflicts

Implementation Reference

  • The main handler function that executes the git rebase command based on provided arguments, handling special cases like abort, continue, and interactive.
    export async function gitRebase(args: z.infer<typeof gitRebaseSchema>): Promise<ToolResponse> {
      if (args.abort) {
        return executeGitCommand('git rebase --abort', args.cwd);
      }
      if (args.continue) {
        return executeGitCommand('git rebase --continue', args.cwd);
      }
      if (args.interactive) {
        return {
          content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Interactive rebase not supported in non-interactive environment' }, null, 2) }],
          isError: true
        };
      }
      if (!args.branch) {
        return {
          content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Branch required for rebase' }, null, 2) }],
          isError: true
        };
      }
      return executeGitCommand(`git rebase ${args.branch}`, args.cwd);
    }
  • Zod schema for input validation of the git_rebase tool parameters.
    export const gitRebaseSchema = z.object({
      branch: z.string().optional().describe('Branch to rebase onto'),
      cwd: z.string().optional().describe('Repository directory'),
      interactive: z.boolean().optional().default(false).describe('Interactive rebase'),
      abort: z.boolean().optional().default(false).describe('Abort current rebase'),
      continue: z.boolean().optional().default(false).describe('Continue rebase after resolving conflicts')
    });
  • src/index.ts:405-408 (registration)
    Dispatch/registration in the main MCP server handler that routes 'git_rebase' calls to the gitRebase function after validation.
    if (name === 'git_rebase') {
      const validated = gitRebaseSchema.parse(args);
      return await gitRebase(validated);
    }
  • MCP tool definition schema for 'git_rebase' used in tool listing.
    {
      name: 'git_rebase',
      description: 'Reapply commits on top of another branch',
      inputSchema: {
        type: 'object',
        properties: {
          branch: { type: 'string', description: 'Branch to rebase onto' },
          cwd: { type: 'string', description: 'Repository directory' },
          interactive: { type: 'boolean', default: false, description: 'Interactive rebase (not supported)' },
          abort: { type: 'boolean', default: false, description: 'Abort current rebase' },
          continue: { type: 'boolean', default: false, description: 'Continue rebase after resolving conflicts' }
        }
      }
    },
  • src/index.ts:284-296 (registration)
    Registration of gitTools (including git_rebase) in the MCP list tools handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          ...filesystemTools,
          ...shellTools,
          ...dockerTools,
          ...mongodbTools,
          ...redisTools,
          ...gitTools,
          ...processTools,
          ...networkTools
        ]
      };
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. It mentions 'reapply commits' but fails to explain that rebasing rewrites commit history, can be destructive, may require conflict resolution, or has implications for shared branches. This leaves significant gaps in understanding the tool's behavior and risks.

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, efficient sentence with zero waste. It's front-loaded and appropriately sized for a tool with a well-documented schema. Every word earns its place by directly conveying the core action without unnecessary elaboration.

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

Completeness2/5

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

Given the complexity of git rebase (a potentially destructive operation with multiple parameters), no annotations, and no output schema, the description is insufficient. It doesn't cover behavioral traits, usage context, or output expectations, leaving the agent under-informed for safe and effective use.

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 description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds no additional meaning beyond what the schema provides, such as explaining parameter interactions or constraints. Baseline 3 is appropriate when the schema does the heavy lifting, but the description doesn't compensate with extra insights.

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 'Reapply commits on top of another branch' clearly states the verb ('reapply') and resource ('commits'), making the purpose understandable. It distinguishes from siblings like git_merge or git_reset by focusing on commit reapplication rather than merging or resetting. However, it doesn't explicitly differentiate from all git siblings, keeping it at 4 instead of 5.

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 like git_merge or git_rebase's interactive mode. It lacks context on prerequisites, such as needing a clean working directory or when rebasing is appropriate. No exclusions or explicit alternatives are mentioned, leaving usage unclear.

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/ConnorBoetig-dev/mcp2'

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