Skip to main content
Glama
shanghaitech-mail-mcp

shanghaitech-mail-mcp

搜索邮件

mail_search

Search email folders by sender, recipient, subject, body keyword, date range, unread status, or attachment presence, returning matching metadata and optional previews—not full message bodies.

Instructions

在指定文件夹内搜索邮件,返回元数据列表(uid / 主题 / 发件人 / 日期 / 已读状态 / 大小 / 可选摘要),不返回正文全文。支持按发件人、收件人、主题、正文关键词、日期区间、未读、附件存在等条件。用于「这周有哪些通知」「助教发过什么邮件」「找某个附件」这类需求。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "mail_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNo收件人包含该字符串
bodyNo正文包含该字符串(服务端 IMAP 全文检索)
fromNo发件人包含该字符串
textNo任意位置包含该字符串(等价于 IMAP TEXT 条件,较慢)
limitNo最多返回多少封,默认 20,上限 500(批量清理时用)
sinceNo起始日期 YYYY-MM-DD(含当天,按服务器时区)
beforeNo截止日期 YYYY-MM-DD(不含当天)
folderNo文件夹名,默认 INBOX。可用 mail_list_folders 查。
offsetNo跳过前 N 封(配合 limit 翻页;按 uid 倒序计)
previewNo是否为每封邮件抓取正文摘要,默认 true(最多抓 10 封)
subjectNo主题包含该字符串
uids_onlyNo只返回 uid 列表,不拉元数据(批量清理时快得多)
unread_onlyNo只看未读

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are supplied, so the description must carry the behavioral burden. It discloses that results are metadata-only and not full bodies, but omits explicit read-only/side-effect status, authentication requirements, and performance characteristics (e.g., that text search is slower).

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 sentences, front-loaded with the core action and return format, followed by conditions and use cases. The condition list is somewhat long but informative; no major waste.

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 13-parameter tool with no annotations and no output schema, the description covers the return shape and typical use cases well. It falls short on behavioral context (read-only nature, auth, performance) and contains the unsupported attachment condition, so it is adequate but not fully complete.

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%, so the schema already documents all 13 parameters thoroughly. The description adds a useful summary of supported conditions (sender, recipient, subject, body, date range, unread), but it also claims 'attachment existence' support that is absent from the schema, slightly reducing reliability.

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 the specific verb (search), resource (emails), folder scope, and exact return fields (uid/subject/sender/date/read status/size/optional summary), and explicitly contrasts with full-body retrieval. This makes it clearly distinguishable from mail_read and other siblings.

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?

Provides three concrete usage examples (weekly notifications, emails from a TA, finding an attachment), giving clear context for when to use. However, it does not name alternative tools or state when not to use this search (e.g., for full message bodies or listing folders), leaving some inference to the agent.

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