Prepare an attachment upload
prepare_attachment_uploadGet a one-time link for uploading a file to attach to an email. The file itself never goes through tool arguments: run the returned upload command (curl) to send it, which needs the ability to run shell commands or make HTTP requests. Give the file's exact size in bytes. After the upload succeeds, pass the attachment_id to add_draft or email_send in attachment_ids. Files can be up to about 18 MB (25 MB once encoded).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | The file's exact size in bytes (e.g. from `wc -c < file` or `stat`). The upload must be exactly this long. | |
| Yes | The email account the file will be sent from (e.g. "user@gmail.com"). | ||
| filename | Yes | The name the attachment will have in the email, e.g. "invoice.pdf". A path is reduced to its last component. | |
| mime_type | No | The file's MIME type, e.g. "application/pdf". Guessed from the filename's extension when omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | The size the upload must be, in bytes. | |
| filename | Yes | The filename the email will show. | |
| mime_type | Yes | ||
| expires_at | Yes | When the link stops working, as RFC 3339. An uploaded file stays usable for 15 minutes after it arrives. | |
| upload_url | Yes | Where to PUT the file. It works once, without an Authorization header. | |
| attachment_id | Yes | The file's ID. Once the file is uploaded, this is what the send tools take. | |
| upload_command | Yes | The command that uploads the file; replace <path> with the file's local path. |