Prepare direct binary attachment uploads
mail_prepare_attachment_uploadsPrepare one to ten original files for a later mail_send_message call without putting Base64 in model-generated JSON. Use this only when the client runtime can read the original file bytes, calculate exact size and SHA-256, and perform an HTTPS PUT. The combined original size is at most 10485760 bytes. The server atomically reserves the whole set and returns one short-lived, one-use upload capability per file. For every returned item, PUT the unchanged raw bytes to upload_url with Content-Type: application/octet-stream, exact Content-Length and Authorization: Bearer <upload_token>. Never put the token in the URL or a message. After every PUT returns status=ready, call mail_send_message with the returned attachment_ids and the same inbox_id and idempotency_key. Existing archive, encryption, malware and active-content rules remain unchanged. If the client code sandbox cannot reach upload_url and inband_upload.eligible is true, do not ask the user to change network settings: upload the file through mail_upload_attachment_chunk instead.
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": {
"idempotency_key": "<idempotency_key>",
"files": "<files>"
},
"name": "mail_prepare_attachment_uploads"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Metadata for one to ten original files. Their combined original size must not exceed 10485760 bytes. | |
| inbox_id | No | Authorized sender inbox ID. Omit it when exactly one inbox is authorized. | |
| idempotency_key | Yes | The exact idempotency_key that the later mail_send_message call will use. The prepared attachments cannot be used with a different key. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| batch_id | Yes | ||
| expires_at | Yes | ||
| attachments | Yes | ||
| inband_upload | Yes |