Upload files to attach
attachments_generate_upload_linkCreates an upload link (valid 30 minutes, up to 10 files and 150 MB in all) for files to attach to a message. Use it instead of content_base64 for a file on your own disk, and for a file only the user has. If you can make HTTP requests, upload each file yourself, one at a time: PUT its raw bytes (not multipart, not base64) to put_url with ?name= and the URL-encoded file name, with its Content-Type (curl -T works), then POST finish_url once. Otherwise give the user url, a page where they drop the files, and ask them to say when they are done. Then call attachments_check_upload_status and pass its upload tokens to mail_send, mail_reply, mail_forward or mail_create_draft. Example: {}.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "attachments_generate_upload_link"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Shown on the upload page, e.g. "The signed contract". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The upload page, for the user. | |
| put_url | Yes | For an agent: PUT one file's raw bytes to put_url?name=<URL-encoded file name>; one file at a time. | |
| upload_id | Yes | ||
| expires_at | Yes | ||
| finish_url | Yes | For an agent: POST here, no body, once every file is in; then call attachments_check_upload_status. |