Skip to main content
Glama

把用户发来的附件下载到本地

feishu_download

Downloads attachments or images from a Feishu message to local disk and returns the absolute path for bash or script processing; auto-detects file keys from message content when omitted.

Instructions

下载某条飞书消息里的附件(文件或图片)到本地磁盘,返回绝对路径,之后就能用 bash/脚本处理它。典型链路:用户发来一个 docx → 本工具下载 → 本地解析/改写 → feishu_send_file 发回。不传 file_key 时会自动从消息 content 里取(file_key 或 image_key);落盘名优先用消息里自带的名字,没有就用 _<fileKey前8位>.<后缀>,同名文件自动加 -1 后缀不覆盖。

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": "feishu_download"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNo资源类型,默认 file;图片消息不填时自动按 image 下载
dest_dirNo落盘目录,默认 ./downloads(相对当前工作目录,内部会 path.resolve)
file_keyNo资源 key;不填则从消息 content 里自动识别 file_key / image_key
message_idYes消息 id(om_ 开头),从 feishu_list_messages 之类的结果里拿

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Goes beyond the annotations by disclosing filesystem behavior: it writes to a resolved local directory, auto-extracts file_key/image_key from message content when omitted, and applies a naming fallback with a -1 suffix to avoid overwriting. It does not mention auth requirements or error behavior, but the file-writing and collision semantics are the important context here and are consistent with readOnlyHint=false.

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

Conciseness4/5

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

Front-loads the purpose and typical workflow, then the fallback and naming rules. Dense but every sentence carries information; slightly long but no filler.

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?

For a four-parameter tool with no output schema, it discloses the return value (absolute path), the workflow placement, the auto-detection fallback, and the naming/overwrite behavior. Missing only edge-case failure handling, which is minor.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all four parameters including the file_key auto-detection fallback. The description reinforces the fallback and the naming convention but adds little parameter-level meaning the schema does not already provide, so baseline 3 applies.

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 and resource (下载某条飞书消息里的附件,文件或图片) plus the destination (本地磁盘) and the return value (绝对路径). It also distinguishes itself from the sibling feishu_send_file by naming the opposite direction of the workflow.

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?

The 典型链路 sentence gives clear context for when to use it (a user sends a docx → download → parse locally → send back with feishu_send_file). It names the downstream alternative for the return path but gives no explicit when-not condition or exclusion.

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