download_attachment
Saves an Outlook email attachment or inline image to disk by message ID and returns JSON metadata so AI agents can read the media file directly.
Instructions
Download an Outlook email attachment or inline screenshot to disk and return structured JSON { ok, path, file_name, mime_type, size_bytes, is_image } so multimodal AI agents can read media directly from disk. Fetches the full attachment bytes with Graph requests unless offline reads them from the cache; time grows with file size.
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": {
"message_id": "<message_id>"
},
"name": "download_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offline | No | Read cached message metadata/inline bytes from SQLite without Graph API call | |
| attachment | No | Attachment ID, filename, or 0-based index | |
| message_id | Yes | Outlook message ID | |
| output_dir | No | Target directory on disk (defaults to configured download_dir) | |
| attachment_index | No | 0-based attachment index (defaults to first image or first attachment) |