> ## 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 · Code

> Tools to read the file tree, read a file, write commits and search text in the code.

Tools to read the file tree, read a file, write commits and search text in the code.

| Tool | What it does | Type |
| - | - | - |
| `get_presentation` | Lê a apresentação validada, commit aplicado e erros, sem publicar o executável. | Read |
| `validate_presentation` | Valida ui/site/ de uma branch ou commit. Não aplica branches de trabalho. | Read |
| `ensure_presentation_files` | Adiciona apenas arquivos ui/site/ ausentes ao repositório antigo. Não sobrescreve o executável. Exige expected\_head. | Write |
| `read_tree` | Lists the files of a branch or commit. | Read |
| `read_file` | Content of a file. | Read |
| `write_files` | Writes a commit. Read the branch head in list\_branches and send it in expected\_head. content null deletes the file. | Write |
| `search_code` | Searches text in every file of a ref (up to 50 results). | Read |

## get\_presentation

**Ver apresentação aplicada.** Lê a apresentação validada, commit aplicado e erros, sem publicar o executável.

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

### Parameters

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

Script ID (uuid)

### Example

```json Request theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_presentation",
    "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
  }
}
```

## validate\_presentation

**Validar cartão e popup.** Valida ui/site/ de uma branch ou commit. Não aplica branches de trabalho.

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

### Parameters

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

Script ID (uuid)

**ref** `string`

Branch ou commit

### Example

```json Request theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "validate_presentation",
    "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
  }
}
```

## ensure\_presentation\_files

**Preparar apresentação.** Adiciona apenas arquivos ui/site/ ausentes ao repositório antigo. Não sobrescreve o executável. Exige expected\_head.

> [!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)

**expected\_head** `string | null` *required*

—

### Example

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

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

## read\_tree

**Read tree.** Lists the files of a branch or commit.

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

### Parameters

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

Script ID (uuid)

**ref** `string`

Branch or SHA (default: main)

### What it calls in the API

Por baixo, a ferramenta usa `GET /scripts/{script_id}/repo/tree` 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": "read_tree",
    "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
  }
}
```

## read\_file

**Read file.** Content of a file.

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

### Parameters

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

Script ID (uuid)

**path** `string` *required*

Path, e.g. src/script.js

**ref** `string`

Branch or SHA

### What it calls in the API

Por baixo, a ferramenta usa `GET /scripts/{script_id}/repo/files/{path}` 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": "read_file",
    "arguments": {
      "script_id": "8f0c2c1e-5b0a-4d2e-9a61-3f7d2b1c9e40",
      "path": "src/script.js"
    }
  }
}
```

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

## write\_files

**Write files.** Writes a commit. Read the branch head in list\_branches and send it in expected\_head. content null deletes the file.

> [!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)

**branch** `string`

Branch (default: main)

**expected\_head** `string` *required*

Current head\_sha of the branch

**message** `string` *required*

Commit message

**changes** `object[]` *required*

List of items.

**fields of each item**

**path** `string` *required*

Item field.

**content** `string | null` *required*

Item field.

### What it calls in the API

Por baixo, a ferramenta usa `POST /scripts/{script_id}/repo/commits` 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": "write_files",
    "arguments": {
      "script_id": "8f0c2c1e-5b0a-4d2e-9a61-3f7d2b1c9e40",
      "expected_head": "3b1f0e9c2a7d4b6e8f0a1c3d5e7f9a1b2c3d4e5f",
      "message": "Atualiza o botão",
      "changes": [
        {
          "path": "src/script.js",
          "content": "// novo conteúdo"
        }
      ]
    }
  }
}
```

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

## search\_code

**Search code.** Searches text in every file of a ref (up to 50 results).

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

### Parameters

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

Script ID (uuid)

**query** `string` *required*

Text

**ref** `string`

Branch or SHA

### What it calls in the API

Por baixo, a ferramenta usa `GET /scripts/{script_id}/repo/tree`, `GET /scripts/{script_id}/repo/files/{path}` 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": "search_code",
    "arguments": {
      "script_id": "8f0c2c1e-5b0a-4d2e-9a61-3f7d2b1c9e40",
      "query": "createCard"
    }
  }
}
```

```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.