download_attachment
Download an inline image from a Teams message or reply to get a local file path. Provide message, chat, or team/channel IDs with the hosted content ID.
Instructions
Download an inline image (hosted content) from a message.
For channel messages: provide team_id + channel_id + message_id.
For content inside a channel REPLY: additionally pass parent_message_id
(the thread root id) - Graph serves reply content only under
/messages/{parent}/replies/{reply}.
For chat messages: provide chat_id + message_id.
hosted_content_id: from the hostedContents array in message data.
Returns the local file path to the downloaded image. File attachments listed under
attachments (SharePoint/OneDrive files) cannot be downloaded with this tool. The
image is written to the system temp directory on the machine running this server
and is not deleted afterwards.
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>",
"hosted_content_id": "<hosted_content_id>"
},
"name": "download_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | No | ||
| team_id | No | ||
| channel_id | No | ||
| message_id | Yes | ||
| hosted_content_id | Yes | ||
| parent_message_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |