download_attachment
Downloads a Teams message attachment or inline screenshot to local disk so agents or users can inspect it, saving to a specified or configured downloads folder.
Instructions
Download a file attachment or inline Teams screenshot (hostedContents) from a message to local disk so an agent or user can inspect it. Writes a file to out_dir (or configured downloads folder); latency scales with attachment size. Returns { ok, path (absolute), file_name, mime_type, size_bytes, bytes_written, is_image }.
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": {
"target": "<target>",
"msg_id": "<msg_id>"
},
"name": "download_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | 0-based index into the message's attachments/hosted images (default 0). | |
| msg_id | Yes | Message ID containing the attachment or inline image. | |
| target | Yes | Conversation conv_key (chat:... or chan:team:channel), "Team/Channel", or unique conversation title substring. | |
| out_dir | No | Optional local directory to save the downloaded file (defaults to configured downloads folder). | |
| thread_root_id | No | Optional channel thread root post ID required when msg_id is a reply inside a channel thread. |