Append one chunk of a single file to a staging session
add_file_chunkSend one file in several calls when it is too big for a single tool call. Last resort: first try add_files with encoding:'gzip+base64' (about 250 KB of text in one call), begin_deploy's uploadUrl (one 100 MB tar POST) or deploy_from_url (public archive URL). When chunking, gzip+base64 each chunk too, mark the first with isFirst and the last with isLast, and send chunks of one file one after another: parallel chunks corrupt it. After a transport error, do not resend the chunk blindly: restart the file from its first chunk (isFirst truncates it).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"deployId": "<deployId>",
"path": "<path>",
"content": "<content>",
"isFirst": "<isFirst>",
"isLast": "<isLast>"
},
"name": "add_file_chunk"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path relative to the site root, e.g. 'portaal-admin.html'. Same rules as add_files. | |
| isLast | Yes | True on the final chunk: returns the assembled file size and refreshes the session file count. | |
| content | Yes | This chunk's bytes, as UTF-8 text or encoded per encoding. Chunk size is limited by your client's tool-output budget, not by the server: about 80 KB of base64 (60 KB raw) per chunk is a safe upper bound. | |
| isFirst | Yes | True on the first chunk of a file: truncates any staged file at this path and creates parent directories. | |
| deployId | Yes | Session id returned by begin_deploy. | |
| encoding | No | utf8 (default), base64 (binary), or gzip+base64 (gzip this chunk locally; the server gunzips before appending). Set per chunk. | |
| expectedByteOffset | No | Optional check: where this chunk starts in the assembled file (0 for the first chunk, else the decoded bytes sent so far). A mismatch fails with MISALIGNED_CHUNK before writing, which catches base64 split mid-byte. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| isLast | Yes | ||
| deployId | Yes | ||
| fileSize | No | Assembled file size on the pod after this chunk. Returned only when isLast=true so the caller can verify the concat succeeded. | |
| totalBytes | Yes | Session-wide cumulative bytes across all add_files / add_file_chunk calls. | |
| totalFiles | No | Session-wide file count after this chunk. Returned only when isLast=true. | |
| bytesWritten | Yes | Decoded bytes written by THIS chunk. | |
| remainingBudget | Yes | Bytes still available before hitting the 500 MB cap. |