Upload one verified attachment chunk through MCP
mail_upload_attachment_chunkFallback for a hosted client whose code sandbox cannot make the raw HTTPS PUT returned by mail_prepare_attachment_uploads. Use only when that result says inband_upload.eligible=true. Read at most 8192 unchanged bytes from the original file at offset 0, encode that byte range once as standard padded RFC 4648 Base64, calculate SHA-256 over the same decoded range, and call this tool. Continue immediately from next_offset until complete=true without pausing to analyze, summarize or explain the file between calls. Every successful chunk renews a 10-minute idle window, bounded by 2 hours from prepare. A retry with the identical offset, bytes and chunk hash is idempotent. If one chunk fails integrity, reread and retry only that range. Never summarize, convert or recreate the file. This in-band fallback is limited to 262144 original bytes per prepared set; larger sets require raw PUT. After every attachment is ready, call mail_send_message with attachment_ids and the original idempotency_key.
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": {
"attachment_id": "<attachment_id>",
"offset": "<offset>",
"content_base64": "<content_base64>",
"chunk_sha256": "<chunk_sha256>"
},
"name": "mail_upload_attachment_chunk"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | Yes | Zero-based original byte offset. Start at 0, then use next_offset from the previous successful response. | |
| chunk_sha256 | Yes | Lowercase SHA-256 of this decoded chunk only. The server also verifies the whole-file SHA-256 declared during prepare. | |
| attachment_id | Yes | Attachment ID returned by mail_prepare_attachment_uploads. | |
| content_base64 | Yes | One small unchanged byte range encoded once as standard padded RFC 4648 Base64. Do not include a data: prefix, whitespace, Markdown or file path. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | ||
| complete | Yes | ||
| security | No | ||
| next_offset | Yes | ||
| attachment_id | Yes | ||
| expected_size | Yes |