Skip to main content
Glama

download_hosted_content

Retrieve an inline image or hosted content from a Microsoft Teams chat or channel message using its message and hosted content IDs, with options to view it directly or save it to a file.

Instructions

Download one inline hosted-content item (usually an image).

Specify the message location with exactly one of:

  • chat_id (for a chat message), or

  • team_id AND channel_id (for a channel message).

Get message_id and hosted_content_id from a message's hosted_content_refs (returned by list_chat_messages / list_channel_messages / list_message_replies).

Args: message_id: Graph id of the message the content is attached to. hosted_content_id: Graph hosted-content id (from hosted_content_refs). chat_id: Chat id, if the message is in a chat. team_id: Team id, if the message is in a channel. channel_id: Channel id, if the message is in a channel. save_path: Write the bytes to this file path (or into this existing directory) instead of returning content. Returns {"path", "content_type", "size_bytes"} with no content payload. include_raw: Include the raw payload under "raw" (ignored when the result is an image block or a saved file).

Returns: - Image content (PNG/JPEG/GIF/WebP, no save_path): metadata plus the image itself as a native MCP image block, viewable directly. - With save_path: {"path": str, "content_type": str | None, "size_bytes": int}. - Otherwise: {"content_type": str | None, "size_bytes": int, "content_base64": str | None}. content_type is sniffed from the bytes (Graph does not return it on the $value endpoint); it may be None for unrecognized formats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idNo
team_idNo
save_pathNo
channel_idNo
message_idYes
include_rawNo
hosted_content_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.2

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does so thoroughly. It discloses three distinct return shapes, the save_path side effect (writes to disk and suppresses content payload), include_raw behavior, and the fact that content_type is sniffed and may be None. This is far beyond what an agent could infer from the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is organized into clear, scannable sections: one-line summary, location constraint, ID sourcing, Args, and Returns. Every sentence carries useful operational information, and the most important disambiguation is front-loaded. No filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a relatively complex tool with 7 parameters, no output schema, and no annotations. The description covers all parameters, all return variants, edge cases (image blocks, file saving, unknown content types), and the exact source of required IDs. Nothing needed to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the Args section adds rich meaning to every parameter: the exclusivity constraint on chat_id/team_id/channel_id, the source of hosted_content_id, the effect of save_path (file path vs directory, return shape), and include_raw's conditional behavior. This fully compensates for the empty schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Download'), a precise resource ('one inline hosted-content item'), and differentiates it from sibling attachment tools by clarifying it handles hosted-content items typically referenced in message hosted_content_refs. The first sentence alone is sufficient to disambiguate it from download_attachment.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit usage context: how to locate the message, the mutually exclusive location options (chat_id vs team_id + channel_id), and where to source message_id and hosted_content_id. It does not explicitly name when to prefer sibling download_attachment over this tool, so it falls just short of full alternative-routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.