# Upsert file chunks

Tool: `veryfront__upsert_file_chunks`

Upsert file chunks. Requires project.knowledge.write.

## Arguments

| Name                | Type            | Required | Description                                                                 |
| ------------------- | --------------- | -------- | --------------------------------------------------------------------------- |
| `project_reference` | string          |          | Project identifier or slug that scopes the tool call.                       |
| `branch_name`       | string          | Yes      | Branch whose copy of the file is chunked.                                   |
| `file_path`         | string          | Yes      | Project-relative path of the chunked file.                                  |
| `chunks`            | array of object | Yes      | Replacement batch of 1 to 500 chunks; each content string must be nonempty. |

## 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__upsert_file_chunks",
    "arguments": {
      "branch_name": "string",
      "file_path": "string",
      "chunks": [
        {
          "index": 0,
          "content": "string",
          "start_offset": 0,
          "end_offset": 0,
          "token_count": 1
        }
      ]
    }
  }
}'
```

## Example response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"chunks\":[{\"id\":\"string\",\"index\":0}],\"created\":0,\"updated\":0}"
      }
    ],
    "structuredContent": {
      "chunks": [
        {
          "id": "string",
          "index": 0
        }
      ],
      "created": 0,
      "updated": 0
    }
  }
}
```
