gmail_download_attachment
Download a Gmail attachment's content by name. Save it to a specified directory on local installs, or receive it inline or via a link on organization-managed installs.
Instructions
Download a Gmail attachment's content. Identify the attachment by the name returned from gmail_list_message_attachments. Local install: saved to destination_dir (required, no default): pass ~/Downloads, or a path the user asked for, if they should find the file afterward, or your own scratch directory if it is only for you to read. Organization-managed install: destination_dir is ignored; a small attachment comes back inline in the result, a larger one as a one-time link the human opens in their own signed-in browser. Returns {path, name, size_bytes} for a file saved on a local install (a save through the file bridge returns {path, delivery} instead), the file content inline, or {delivery: 'link', name, size_bytes, download_url, expires_at, note}. Requires user approval.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | One sentence: why are you calling this tool right now? | |
| message_id | Yes | Id of the Gmail message, from gmail_list_messages (its id field). | |
| attachment_name | Yes | File name of the attachment, exactly as gmail_list_message_attachments returns it in its name field; a name that matches none fails. | |
| destination_dir | Yes | Local install only: where to save the attachment -- required, no default. On an organization-managed install it is ignored and nothing is saved to it; any value will do. Use ~/Downloads (or a path the user specified) if the user should find this file afterward; use your own working/scratch directory if it's only for you to read or process. |