Skip to Content
ReferenceToolsfs_upload_begin

fs_upload_begin

Begin a resumable create-only upload, up to 256 MiB. Bind a client-generated id, size and SHA-256; expires in 15 minutes. Use SDK upload helpers for bytes.

Arguments

Over MCP every tool also takes machine: the machine’s name or id, optional when only one machine is online.

NameTypeRequiredMeaning
mkdirsbooleannoCreate missing parent folders. Default: false. Default: false.
pathstringyesDestination on the machine. Existing files are never replaced.
sha256stringyesExpected whole-file SHA-256: 64 lowercase hexadecimal characters.
sizeintegeryesExact decoded byte count, at most 268435456 (256 MiB).
transferstringyesClient-generated id: 32 lowercase hexadecimal characters. Reuse only for this upload.

Result

NameTypeRequiredMeaning
chunk_max_bytesintegeryesMaximum decoded bytes in a chunk.
expires_atintegeryesFixed expiry as Unix seconds.
offsetintegeryesDurable confirmed byte offset. Only continue from this value.
pathstringyesBound canonical absolute destination.
receiptobjectnoPresent only after verified publication.
sha256stringyesExpected whole-file SHA-256; a committed receipt confirms verification.
sizeintegeryesExpected whole-file decoded bytes.
state"uploading" | "committed" | "aborted" | "expired"yesCurrent durable state.
transferstringyesClient-generated upload id.

Examples

{ "name": "fs_upload_begin", "arguments": { "machine": "<machine>", "transfer": "<transfer>", "path": "<path>", "size": 0, "sha256": "<sha256>" } }

Limits

The call times out after 60 s (timed_out). Available since version 0.1.18. A refused or failed call returns one of the error codes.

Notes

Generate the transfer identifier in code and save it before the first call. Reuse it only for the same source bytes, destination and authenticated client. The identifier alone does not grant access. Every upload operation still requires the current write grant and the machine’s ceiling.

A machine accepts at most four active uploads and reserves at most 512 MiB of their declared sizes in total. The 15-minute expiry starts at begin and does not move when chunks arrive. Keep the identifier after an uncertain reply and inspect fs_upload_status before continuing.

For local files, use the SDK upload helpers to compute hashes and send bounded chunks in code. Access to the source file must already exist in that runtime; a ChatGPT file reference is not a local source path.