Skip to main content
Glama
shanghaitech-mail-mcp

shanghaitech-mail-mcp

保存附件到工作区

mail_save_attachment

Saves a selected email attachment to the workspace for local storage or parsing, using the message UID and attachment index returned by mail_read.

Instructions

把某封邮件的附件落盘到工作区(可用于把助教的 PPT / 作业 PDF 存到本地再解析)。index 来自 mail_read 返回的 attachments 列表。默认存到 _素材/邮箱附件/。

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": {
      "uid": "<uid>",
      "index": "<index>"
    },
    "name": "mail_save_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
uidYes邮件 uid
indexYes附件序号,来自 mail_read 的 attachments[].index
folderNo邮件所在文件夹,默认 INBOX
save_dirNo保存目录;相对路径按工作区根目录解析,默认 _素材/邮箱附件

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that this is a disk write, the default destination directory (_素材/邮箱附件/), and the dependency on mail_read. It does not say whether existing files are overwritten, whether the saved path is returned, or what happens if the index is invalid, which are material gaps for a write operation.

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?

Three short sentences, front-loaded with the action, followed by the prerequisite and the default destination. Nothing is padded. The example use case is slightly narrow and colloquial but earns its place as usage guidance.

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

Completeness3/5

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

For a four-parameter write tool with no annotations and no output schema, the definition covers the action, prerequisite, and destination, but leaves the return value (e.g., the saved path) and collision/overwrite behavior unstated. An agent can invoke it, but cannot predict the result or side effects fully.

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 coverage is 100% and every parameter is already documented, including that index comes from mail_read's attachments[].index and that save_dir defaults to _素材/邮箱附件. The description repeats these facts rather than adding new meaning, so the baseline 3 applies.

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

Purpose4/5

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

States a specific verb and resource: write a mail attachment to disk in the workspace. The parenthetical use case (save the TA's PPT / homework PDF locally, then parse) makes the outcome concrete. It also ties itself to mail_read as the source of the index, which helps separate it from the read-side siblings, though it does not explicitly name what it is not for.

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 a clear usage context (download attachments for local parsing) and a prerequisite workflow: the index must come from mail_read's attachments list, so mail_read must run first. No explicit when-not-to-use or exclusion is stated, which keeps it short of a 5.

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