AgentSkillsCN

email-summary

针对指定时间段内的 Gmail 和 Exchange 账户邮件进行摘要整理,并保存为本地的 Markdown 文件。邮件将被划分为若干可操作的类别:待办事项、亟需回复、信息类,以及其它。当用户希望获取邮件摘要、总结近期邮件、生成邮件报告、回顾某一时间段内的邮件往来,或导出邮件摘要时,可使用此技能。触发词包括:“邮件摘要”、“总结邮件”、“邮件摘要”、“邮件报告”、“哪些邮件”、“近期邮件摘要”、“上周的邮件”、“邮件汇总”。

SKILL.md
--- frontmatter
name: email-summary
description: >
  Summarize emails from Gmail and Exchange accounts for a specified time period and save
  to a local markdown file. Categorizes emails into actionable groups: Tasks, Response Needed,
  Informational, and Other. Use this skill whenever the user wants to: get an email digest,
  summarize recent emails, create an email report, review emails from a date range, or
  export email summaries.
  Triggers: "email summary", "summarize emails", "email digest", "email report",
  "what emails", "recent emails summary", "emails from last week", "email roundup".

Email Summary — Gmail & Exchange Integration

Summarize emails from configured Gmail and Exchange accounts, categorize them by action type, and save to a local markdown file in operations/emails/.

Available MCP Tools

Gmail Tools

ToolPurpose
mcp__gmail__gmail_list_accountsList configured Gmail accounts
mcp__gmail__gmail_searchSearch emails with Gmail query syntax
mcp__gmail__gmail_get_threadGet full email thread by ID
mcp__gmail__gmail_summarizeGet thread content formatted for summarization

Exchange Tools

ToolPurpose
mcp__exchange__exchange_list_accountsList configured Exchange accounts
mcp__exchange__exchange_searchSearch emails with KQL syntax
mcp__exchange__exchange_get_messageGet full message details
mcp__exchange__exchange_get_threadGet conversation thread

Workflow

1. Determine Time Period

Ask the user for the date range if not specified. Common patterns:

  • "today" → current date
  • "yesterday" → previous day
  • "this week" → Monday to today
  • "last week" → previous Monday to Sunday
  • "last 7 days" → rolling 7 days
  • Custom range: "from YYYY-MM-DD to YYYY-MM-DD"

2. List Available Accounts

code
mcp__gmail__gmail_list_accounts()
mcp__exchange__exchange_list_accounts()

Present the list and confirm which accounts to include (default: all).

3. Fetch Emails

Gmail (use date query syntax):

code
mcp__gmail__gmail_search(account="<name>", query="after:2026/01/01 before:2026/01/08", max_results=50, include_body=true)

Exchange (use KQL syntax):

code
mcp__exchange__exchange_search(account="<name>", query="received:2026-01-01..2026-01-07", max_results=50, include_body=true)

4. Categorize Each Email

Review each email and assign to ONE category:

CategoryCriteriaExamples
TasksExplicit action required, assignments, deadlines"Please complete by Friday", "Action required", task assignments
Response NeededAwaiting your reply, questions directed at youDirect questions, meeting requests pending response, approval requests
InformationalFYI, newsletters, updates, notificationsStatus updates, automated notifications, newsletters, announcements
OtherDoesn't fit above categoriesSpam, promotional, unclear intent

5. Generate Summary Document

Filename convention: YYYY-MM-DD-email-summary.md (use end date of range)

Output location: operations/emails/

Markdown format:

markdown
# Email Summary: [Start Date] to [End Date]

**Generated:** YYYY-MM-DD HH:MM
**Accounts:** account1, account2, account3
**Total Emails:** N

---

## Tasks That Need To Be Done

| Source | From | Subject | Date | Details |
|--------|------|---------|------|---------|
| Gmail/Exchange | sender@example.com | Subject line | YYYY-MM-DD | Brief description of task required |

### Task Details

#### [Subject Line]
- **From:** sender@example.com
- **Date:** YYYY-MM-DD
- **Account:** Gmail (account-name) / Exchange (account-name)
- **Action Required:** [Clear description of what needs to be done]
- **Deadline:** [If mentioned]

---

## Response Needed

| Source | From | Subject | Date | Details |
|--------|------|---------|------|---------|
| Gmail/Exchange | sender@example.com | Subject line | YYYY-MM-DD | What response is needed |

### Response Details

#### [Subject Line]
- **From:** sender@example.com
- **Date:** YYYY-MM-DD
- **Account:** Gmail (account-name) / Exchange (account-name)
- **Question/Request:** [What they're asking]

---

## Informational

| Source | From | Subject | Date | Summary |
|--------|------|---------|------|---------|
| Gmail/Exchange | sender@example.com | Subject line | YYYY-MM-DD | One-line summary |

---

## Other

| Source | From | Subject | Date | Notes |
|--------|------|---------|------|-------|
| Gmail/Exchange | sender@example.com | Subject line | YYYY-MM-DD | Why categorized here |

---

## Statistics

- **Tasks:** N emails
- **Response Needed:** N emails
- **Informational:** N emails
- **Other:** N emails

6. Save and Confirm

Write the file to operations/emails/YYYY-MM-DD-email-summary.md and confirm the path to the user.

Date Query Reference

Gmail Query Syntax

  • after:YYYY/MM/DD — emails after date
  • before:YYYY/MM/DD — emails before date
  • newer_than:7d — last 7 days
  • older_than:1d — older than 1 day

Exchange KQL Syntax

  • received:YYYY-MM-DD — specific date
  • received:YYYY-MM-DD..YYYY-MM-DD — date range
  • received>=YYYY-MM-DD — on or after date

Tips

  • Large volumes: If >50 emails, summarize in batches and combine.
  • Priority emails: Check importance:high (Exchange) or is:important (Gmail) first.
  • Thread context: Use gmail_get_thread or exchange_get_thread for full conversation context when categorization is unclear.
  • Deduplication: Emails may appear in multiple searches; dedupe by message ID.

Error Handling

  • Account not found → Run list accounts and verify configuration.
  • No emails in range → Confirm date format and expand range.
  • MCP not connected → Check MCP server configuration.