Skip to main content
Glama

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

feishu_download

Downloads files or images from a Feishu message to local disk and returns the absolute path, enabling scripts or workflows to process the attachment. Resolves missing file keys from message content.

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_recent 之类的结果里拿

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.7/5.0
Behavior5/5

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

Even though the annotations only say readOnlyHint=false and openWorldHint=true, the description discloses real behavior: the tool writes to disk and returns an absolute path; the on-disk filename is the message's own name or <messageId>_<fileKey前8位>.<后缀>; a name collision gets a '-1' suffix instead of overwriting; and file_key/image_key is auto-extracted from the message content when not supplied.

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 puts the purpose and return value first, then the typical pipeline, then the parameter edge cases, and it wastes nothing. Every sentence carries operational information.

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?

For a tool with no output schema, the description states the return value (absolute path) and covers defaults such as the ./downloads destination and the no-overwrite naming rule. Nothing the agent needs in order 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.

Parameters4/5

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

With schema coverage at 100%, the schema already documents kind, dest_dir, file_key, and message_id, so a baseline of 3 applies. The description still adds meaning by explaining the auto-detection of file_key/image_key from message content and the filename derivation and collision suffix rules, going beyond what the schema 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 concrete verb, resource, and target: '下载某条飞书消息里的附件(文件或图片)到本地磁盘,返回绝对路径'. It explicitly names the outputs (the absolute path and the ability to process the file with bash/scripts), so the agent can tell this tool apart from listing tools such as feishu_chat_files and from feishu_send_file.

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 description spells out a complete usage chain ('用户发来一个 docx → 本工具下载 → 本地解析/改写 → feishu_send_file 发回'), making the intended position in the workflow unmistakable. It does not explicitly state when not to use this tool or point to a sibling for listing existing chat files, but the positive guidance is strong.

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