Skip to main content
Glama

ui_builder_merge_branch

Destructive

Replay a branch's edits onto its parent's current revision through the same reducer every edit goes through — all or nothing. The reply reports every command: applied with the revision it landed at and any STALE_* notice of what it overwrote, or refused with the rejection code that stopped the run (nothing is then written), plus skippedOperationIds and how many were never tried. Run dryRun: true first: it reports merged: false and wouldMerge (true when every command would land) and writes nothing. Resolve a refusal by passing that command's id in skipOperationIds (skip an undo with what it undoes), or branch again from the parent. On success the branch is merged and its open siblings — branches forked at the same revision — are archived. Needs write access to the parent.

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": {
      "branchId": "<branchId>"
    },
    "name": "ui_builder_merge_branch"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenNoA grant token from poll_access, when you cannot set the X-Compose-Preview-Token header yourself — an MCP client fixes its headers at connect time, so this is how a token approved during this session is used in it. Prefer the header where you control it.
dryRunNoReplay and report without writing anything: the reply's merged is then false and wouldMerge carries the verdict. Defaults to false.
branchIdYes
agentNameNoOptional agent/client name shown to design viewers; self-reported.
agentModelNoOptional current model name shown to design viewers; self-reported. Omit when unknown.
skipOperationIdsNoLogged commands to leave out of the replay.

Output Schema

NameRequiredDescriptionDefault
dryRunYes
mergedYes
schemaYes
summaryYes
branchIdYes
commandsYes
remainingYes
wouldMergeYes
forkRevisionYes
parentDesignIdYes
archivedSiblingIdsNo
parentRevisionAfterYes
skippedOperationIdsNo
parentRevisionBeforeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed3 schema fields changed
    • changedInput schema / properties / dryRun / description
      Previous value: -"Replay and report without writing anything. Defaults to false."New value: +"Replay and report without writing anything: the reply's merged is then false and wouldMerge carries the verdict. Defaults to false."
    • addedOutput schema / properties / wouldMerge
      Added value: +{
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "schema",
      -  "branchId",
      -  "parentDesignId",
      -  "dryRun",
      -  "merged",
      -  "forkRevision",
      -  "parentRevisionBefore",
      -  "parentRevisionAfter",
      -  "commands",
      -  "remaining",
      -  "summary"
      -]New value: +[
      +  "schema",
      +  "branchId",
      +  "parentDesignId",
      +  "dryRun",
      +  "merged",
      +  "wouldMerge",
      +  "forkRevision",
      +  "parentRevisionBefore",
      +  "parentRevisionAfter",
      +  "commands",
      +  "remaining",
      +  "summary"
      +]
  4. Changed2 schema fields changed
    • addedInput schema / properties / agentModel
      Added value: +{
      +  "description": "Optional current model name shown to design viewers; self-reported. Omit when unknown.",
      +  "maxLength": 80,
      +  "type": "string"
      +}
    • addedInput schema / properties / agentName
      Added value: +{
      +  "description": "Optional agent/client name shown to design viewers; self-reported.",
      +  "maxLength": 80,
      +  "type": "string"
      +}
  5. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already flag a destructive, non-idempotent write, and the description adds substantial unsurfaced behavior: the replay is all-or-nothing, a refusal writes nothing, the reducer path is identical to normal edits, success archives open sibling branches forked at the same revision, and write access to the parent is required. These are exactly the consequences an agent cannot infer from hints alone.

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

Conciseness4/5

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

Front-loaded with the core action and atomicity, then failure handling, then side effects — a sensible order. It is dense but nearly every clause carries operational information; the refusal-resolution sentence is slightly packed and could be split for readability.

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

Completeness5/5

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

For a destructive merge tool with six parameters and an output schema, the description covers prerequisites (write access, dry-run first), failure modes and recovery, and the side effect on sibling branches. Return shape is documented in the output schema, so no gap remains that would block a correct call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 83%, so the baseline is 3, but the description adds real meaning: `dryRun` is framed as a mandatory pre-flight whose reply carries `merged: false` plus `wouldMerge`, and `skipOperationIds` is explained as the recovery channel keyed to the command id that caused the refusal. `token` and the agent fields are left to the schema.

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?

States a specific verb and resource: replaying a branch's edits onto the parent's current revision, via the same reducer, atomically. The scope and all-or-nothing semantics make it distinguishable from a plain apply. It never names a sibling it is not, so it stops short of a 5.

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?

Gives an explicit workflow: run `dryRun: true` first, then interpret `merged`/`wouldMerge`. It also prescribes remedies on refusal — pass the command id in `skipOperationIds` (and the special case of skipping an undo with what it undoes) or re-branch from the parent. No guidance on when this beats `ui_builder_apply` or `ui_builder_compare_branches`, which keeps it at 4.

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.