> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doglytdc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP tools · Branches

> Tools to list and create branches, compare them and merge one branch into another.

Tools to list and create branches, compare them and merge one branch into another.

| Tool | What it does | Type |
| - | - | - |
| `list_branches` | Branches with head\_sha. | Read |
| `create_branch` | Creates a branch from a commit (default: head of main). | Write |
| `compare_branches` | Shows what would change and whether merging source into target conflicts (writes nothing). | Read |
| `merge_branch` | Merges source into target. Stops on conflict. | Write |

## list\_branches

**List branches.** Branches with head\_sha.

> [!NOTE]
>
> Read only: changes nothing. Confirmation belongs to the AI client; scopes and blocks still apply.

### Parameters

**script\_id** `string` *required*

Script ID (uuid)

### What it calls in the API

Por baixo, a ferramenta usa `GET /scripts/{script_id}/repo/branches` da [API do Scripts](https://docs.doglytdc.dev/en/scripts/api.md). The response includes text and structuredContent, with secrets removed.

### Example

```json Request theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_branches",
    "arguments": {
      "script_id": "8f0c2c1e-5b0a-4d2e-9a61-3f7d2b1c9e40"
    }
  }
}
```

```json Response theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ ...response JSON... }"
      }
    ],
    "isError": false
  }
}
```

## create\_branch

**Create branch.** Creates a branch from a commit (default: head of main).

> [!NOTE]
>
> Writes or changes script data. Confirmation belongs to the AI client; scopes and blocks still apply.

### Parameters

**script\_id** `string` *required*

Script ID (uuid)

**name** `string` *required*

Name

**from** `string`

Source SHA

### What it calls in the API

Por baixo, a ferramenta usa `POST /scripts/{script_id}/repo/branches` da [API do Scripts](https://docs.doglytdc.dev/en/scripts/api.md). The response includes text and structuredContent, with secrets removed.

### Example

```json Request theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_branch",
    "arguments": {
      "script_id": "8f0c2c1e-5b0a-4d2e-9a61-3f7d2b1c9e40",
      "name": "nova-tela"
    }
  }
}
```

```json Response theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ ...response JSON... }"
      }
    ],
    "isError": false
  }
}
```

## compare\_branches

**Compare.** Shows what would change and whether merging source into target conflicts (writes nothing).

> [!NOTE]
>
> Read only: changes nothing. Confirmation belongs to the AI client; scopes and blocks still apply.

### Parameters

**script\_id** `string` *required*

Script ID (uuid)

**source** `string` *required*

Source branch

**target** `string`

Target (default: main)

### What it calls in the API

Por baixo, a ferramenta usa `POST /scripts/{script_id}/studio/merge` da [API do Scripts](https://docs.doglytdc.dev/en/scripts/api.md). The response includes text and structuredContent, with secrets removed.

### Example

```json Request theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "compare_branches",
    "arguments": {
      "script_id": "8f0c2c1e-5b0a-4d2e-9a61-3f7d2b1c9e40",
      "source": "nova-tela"
    }
  }
}
```

```json Response theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ ...response JSON... }"
      }
    ],
    "isError": false
  }
}
```

## merge\_branch

**Merge.** Merges source into target. Stops on conflict.

> [!NOTE]
>
> Writes or changes script data. Destructive action: review in your AI client before confirming. Confirmation belongs to the AI client; scopes and blocks still apply.

### Parameters

**script\_id** `string` *required*

Script ID (uuid)

**source** `string` *required*

Source branch

**target** `string`

Target (default: main)

**message** `string`

Message

### What it calls in the API

Por baixo, a ferramenta usa `POST /scripts/{script_id}/studio/merge` da [API do Scripts](https://docs.doglytdc.dev/en/scripts/api.md). The response includes text and structuredContent, with secrets removed.

### Example

```json Request theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "merge_branch",
    "arguments": {
      "script_id": "8f0c2c1e-5b0a-4d2e-9a61-3f7d2b1c9e40",
      "source": "nova-tela"
    }
  }
}
```

```json Response theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ ...response JSON... }"
      }
    ],
    "isError": false
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.