upload_attachment
Stage a file to attach to an email sent with send_message (Gmail only) or to a message sent with send_chat_message (AccountHub chat: photos, videos, files). Intended for SMALL files — 数百KB目安: the base64 content passes through the model and costs tokens, so for anything larger prefer giving send_message a public URL via attachment_urls instead. Pass filename + content_base64 (mime_type is inferred from the extension if omitted); the returned upload_id goes into send_message's or send_chat_message's attachment_ids. For files too big for one call, chunk them: first call without upload_id creates the upload, then repeat with the same upload_id + append=true to concatenate (each chunk must be valid base64 by itself). Hard cap 5MB per upload; staged files expire after 24 hours.
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": {
"filename": "<filename>",
"content_base64": "<content_base64>"
},
"name": "upload_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| append | No | true = append this chunk to the existing upload_id instead of creating a new upload. | |
| filename | Yes | File name, e.g. "report.csv" (日本語名可). | |
| mime_type | No | MIME type, e.g. "text/csv". Omit to infer from the filename extension. | |
| upload_id | No | For chunked uploads: the id returned by the first call. Requires append=true. | |
| content_base64 | Yes | The file bytes, base64-encoded. Each chunk must be valid base64 on its own. |