# Update project file draft

Tool: `veryfront__update_project_file_draft`

Update file draft. Requires project.files.write.

## Arguments

| Name                     | Type                                     | Required | Description                                                                                                                                                              |
| ------------------------ | ---------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `project_reference`      | string                                   |          | Project ID or slug; defaults to the current project.                                                                                                                     |
| `branch_reference`       | string · min length 1                    |          | Branch name or UUID. Omit for main; a missing selection is an error.                                                                                                     |
| `path`                   | string · min length 1                    | Yes      | Source-file path or UUID in the selected project/branch.                                                                                                                 |
| `content`                | string                                   | Yes      | Full pending file body. An empty string is valid.                                                                                                                        |
| `expected_draft_version` | integer · min 0 · max 2147483647 \| null |          | Expected current draft sequence, not a committed version ID. 0 requires no prior draft; a stale value returns 409. Omit/null for an unconditional full-body replacement. |

## Responses

| Status | Description                                           |
| ------ | ----------------------------------------------------- |
| 200    | The tool ran; its output is result.structuredContent. |

## Call it

```bash
curl -X POST -N "https://api.veryfront.com/mcp" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__update_project_file_draft",
    "arguments": {
      "path": "string",
      "content": "string"
    }
  }
}'
```

## Example response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"file_id\":\"00000000-0000-0000-0000-000000000000\",\"entity_type\":\"page\",\"version\":1,\"updated_at\":\"string\",\"path\":\"string\",\"content\":\"string\"}"
      }
    ],
    "structuredContent": {
      "file_id": "00000000-0000-0000-0000-000000000000",
      "entity_type": "page",
      "version": 1,
      "updated_at": "string",
      "path": "string",
      "content": "string"
    }
  }
}
```
