Docs
branch_action MCP tool
Project branches.
MCP name branch_action dispatches to renderer branchAction.
Does not use hosted quota. Local editor operation.
Project branches. action list shows branches and the current branch. action create makes a branch (branchName, optional sourceBranch, switchToBranch). action switch moves the editor (branchId). action merge merges sourceBranch into targetBranch (defaults to main). action mergeToMain merges the current feature branch into main. Merge actions require approval. Editor must be open. Does not use hosted quota. Local editor operation.
Advertised MCP input
This tool is registered with passthrough. The fields below are what listTools advertises. The renderer still validates the child fields for the chosen action or kind. Extra advertised-only values are documented under Reachable behavior.
| Field | Type | Required | Constraints | Default | Description |
|---|---|---|---|---|---|
action | enum("list", "create", "switch", "merge", "mergeToMain") | yes | — | — | action for branch_action |
resultStart | integer | no | min 0; max 9007199254740991 | 0 | First character offset to return. Use 0 for the first call. |
resultEnd | integer | no | min 1; max 9007199254740991 | 8000 | Exclusive end offset. resultEnd - resultStart must be at most 8000. Increment resultStart by 8000 to page through large results. |
Reachable behavior
Advertised action values match the renderer children: list, create, switch, merge, mergeToMain.
Renderer child fields
These are the authoritative fields for each action. Send them on the same MCP call. Grouped MCP tools use passthrough, so these fields are not all listed in the advertised schema.
action=list
Renderer tool: listBranches.
List project versions and identify the currently active version. Use before creating, switching, or combining versions when version names are unclear.
No fields.
action=create
Renderer tool: createBranch.
Create a project version from the current version or a specified source version. By default this also switches the editor to the new version.
| Field | Type | Required | Constraints | Default | Description |
|---|---|---|---|---|---|
branchName | string | yes | minLength 1; maxLength 80 | — | — |
sourceBranch | string | no | minLength 1 | — | — |
switchToBranch | boolean | no | — | true | — |
action=switch
Renderer tool: switchBranch.
Switch the editor to an existing project version. Use listBranches first if you do not know the version ID.
| Field | Type | Required | Constraints | Default | Description |
|---|---|---|---|---|---|
branchId | string | yes | minLength 1 | — | — |
action=merge
Renderer tool: mergeBranch.
Combine one project version into another. Requires user approval before executing. Defaults to combining the current version into main.
| Field | Type | Required | Constraints | Default | Description |
|---|---|---|---|---|---|
sourceBranch | string | no | minLength 1 | — | — |
targetBranch | string | no | minLength 1 | "main" | — |
switchToTarget | boolean | no | — | false | — |
action=mergeToMain
Renderer tool: mergeBranchToMain.
Combine the current version into the main version so changes are kept. Requires user approval before executing. Only works when on a version other than main.
No fields.
Result window
Every local MCP tool accepts resultStart and resultEnd so large payloads can be paged.
resultStart— first character offset. Default0.resultEnd— exclusive end offset. Default8000.resultEnd - resultStartmust be at most 8000 characters.- Increment
resultStartby 8000 to read the next window.
