Skip to main content
Glama
BiteFoundry Teams MCP Server

BiteFoundry Teams MCP Server

download_attachment

Idempotent

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

NameRequiredDescriptionDefault
indexNo0-based index into the message's attachments/hosted images (default 0).
msg_idYesMessage ID containing the attachment or inline image.
targetYesConversation conv_key (chat:... or chan:team:channel), "Team/Channel", or unique conversation title substring.
out_dirNoOptional local directory to save the downloaded file (defaults to configured downloads folder).
thread_root_idNoOptional channel thread root post ID required when msg_id is a reply inside a channel thread.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.1
    • changedInput schema / properties / index / description
      Previous value: -"0-based index into the message's attachments/hosted images."New value: +"0-based index into the message's attachments/hosted images (default 0)."
    • changedInput schema / properties / out_dir / description
      Previous value: -"Optional output directory (defaults to configured downloads folder)."New value: +"Optional local directory to save the downloaded file (defaults to configured downloads folder)."
    • changedInput schema / properties / target / description
      Previous value: -"conv_key, \"Team/Channel\", or unique conversation title."New value: +"Conversation conv_key (chat:... or chan:team:channel), \"Team/Channel\", or unique conversation title substring."
    • changedInput schema / properties / thread_root_id / description
      Previous value: -"Optional channel thread root post ID when msg_id is a thread reply."New value: +"Optional channel thread root post ID required when msg_id is a reply inside a channel thread."
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=false, idempotentHint=true and openWorldHint=true, so the safety bar is low; the description still adds real value by disclosing that it writes to disk, that latency scales with attachment size, and what the response contains. It does not cover overwrite behavior when a file already exists in out_dir or error cases, which would matter given a write side effect.

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?

Three dense sentences: purpose first, side effect and latency second, return shape last. Every clause carries information the agent needs, including the return fields given the absence of an output schema.

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

Completeness4/5

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

With no output schema, the description correctly enumerates the return fields, and it covers the local-disk side effect and size-dependent latency. For a mutation-adjacent tool with openWorldHint=true, it leaves out auth/permission expectations and what happens on failure or on a pre-existing file, which are the remaining gaps.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description goes slightly beyond it by clarifying that out_dir is where the file is written (versus the configured downloads folder) and that the indexed item is an attachment or hostedContents image. It adds no detail on the accepted formats for target or the channel-thread requirement for thread_root_id beyond what the schema already states.

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?

The description gives a specific verb and resource ('Download a file attachment or inline Teams screenshot (hostedContents) from a message to local disk') and states the effect ('Writes a file to out_dir'). It is clearly distinguishable from the sibling send_file, which uploads rather than retrieves, so an agent can select it without opening the schema.

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

Usage Guidelines3/5

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

Usage is implied by 'so an agent or user can inspect it', which signals when retrieval is appropriate, but there is no explicit when-to-use/when-not guidance and no mention of the sibling send_file as the counterpart operation. The prerequisite for channel-thread replies exists only in the schema for thread_root_id, not in the description.

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