Skip to main content
Glama

Merge versions

merge_branch

Combine sourceBranch into targetBranch with a three-way file merge; conflicts fail. targetBranch must be the version sourceBranch was made from (list_branches shows it). A version can be combined again after more edits. Set switchToTarget explicitly. To put the option the person picked in place of one you merged before, merge the picked option's version with the earlier option's version as baseBranch: only what differs between the two options changes, and every other edit stays.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sourceBranch": "<sourceBranch>",
      "targetBranch": "<targetBranch>",
      "switchToTarget": "<switchToTarget>",
      "baseBranch": "<baseBranch>",
      "projectId": "<projectId>"
    },
    "name": "merge_branch"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectIdYesThe project this call runs on without changing the open project. null (or leaving it out) uses the open project. wait_for_jobs takes the projectId of the calls that started the jobs.
baseBranchYesThe version the merge counts the changes from, in place of the two versions' common ancestor: the option you merged before, when the person now picks another. null: the common ancestor.
sourceBranchYes
targetBranchYes
switchToTargetYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / baseBranch
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The version the merge counts the changes from, in place of the two versions' common ancestor: the option you merged before, when the person now picks another. null: the common ancestor."
      +}
    • changedInput schema / required
      Previous value: -[
      -  "sourceBranch",
      -  "targetBranch",
      -  "switchToTarget",
      -  "projectId"
      -]New value: +[
      +  "sourceBranch",
      +  "targetBranch",
      +  "switchToTarget",
      +  "baseBranch",
      +  "projectId"
      +]
  2. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and idempotentHint=false, so mutation and safety are covered structurally. The description adds genuine behavioral context the annotations cannot: conflicts abort the merge, three-way semantics apply, and repeated merges after edits are allowed. However, it never says what state is left behind when a merge fails or what the call returns, which for a non-idempotent mutation is a meaningful omission.

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

Conciseness3/5

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

The merge mechanics are correctly front-loaded in the first sentence, and most sentences earn their place. The final sentence, however, is an overlong run-on about replacing a previously merged option that buries its actionable point (use the earlier option as baseBranch) in a chain of clauses.

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 five-required-parameter mutation with no output schema and 40% parameter coverage, the description covers merge semantics and the baseBranch use case well. It leaves switchToTarget's effect undefined and gives no indication of the result shape or how a conflict failure surfaces, which an agent needs to handle the call correctly.

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 only 40%, so the description carries extra weight. It meaningfully constrains targetBranch (must be sourceBranch's origin) and explains the baseBranch override, though that largely restates the schema's own baseBranch text. The critical gap is switchToTarget: the description says only "Set switchToTarget explicitly" without explaining what switching does or when to set it true versus false — and sourceBranch/targetBranch have no schema descriptions either.

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 opens with a specific verb and resource plus mechanism: "Combine sourceBranch into targetBranch with a three-way file merge; conflicts fail." That is far more than a restatement of the name. It stops short of naming a sibling it is not (e.g., merge_tracks, diff_branches), so an agent must infer the distinction from context.

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?

It states a hard prerequisite ("targetBranch must be the version sourceBranch was made from") and points to list_branches for discovering that relationship, plus a reuse condition ("A version can be combined again after more edits"). It also gives a clear scenario for the baseBranch variant. There are no explicit exclusions or "use X instead" statements, keeping it below a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.