# veryfront__update_file

Update a file. Requires project.files.write.

Risk: mutating.

## Arguments

| Name                  | Type   | Required | Description                                                                                                                                                             |
| --------------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_reference`   | string |          | Project ID or slug                                                                                                                                                      |
| `ref`                 | string |          | Content selector: main or branch:<name-or-id>. Omit for main. Release and environment snapshots are read-only. Supplied aliases must name the same content.             |
| `branch_id`           | string |          | Legacy branch name or ID alias for ref=branch:<value>. Omit for main.                                                                                                   |
| `file_path`           | string |          | Path of the file. Send file\_path or path, not two different values.                                                                                                    |
| `path`                | string |          | File path                                                                                                                                                               |
| `content`             | string |          | Replacement textual content in main or the selected branch, stored as a new immutable version. Source-file MIME type is not writable. Do not combine with str\_replace. |
| `str_replace`         | object |          | Replace one exact occurrence in the current file. Do not combine with content.                                                                                          |
| `expected_checksum`   | string |          | Expected current checksum from get\_file. Omission leaves full-content writes unguarded; string replacement uses the checksum read automatically.                       |
| `expected_version_id` | string |          | Expected current version ID from get\_file. Omission leaves full-content writes unguarded; string replacement uses the version read automatically.                      |

## Call it

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__update_file",
    "arguments": {}
  }
}
```
