Skip to content
All Skills

Gmail Inbox Daily Summary

Fetches today's unread Gmail messages via Google CLI, categorizes them by priority, and generates an actionable daily email briefing. Prerequisites: gcloud, curl, jq.

Email & Communication|v1|Updated 5/18/2026
MCP get_skill({ skillId: "gmail-inbox-daily-summary-69b535b3" })

Use this skill with your agent

Create a free account and connect via MCP

Get Started Free
# Gmail Inbox Daily Summary

Fetch and analyze today's unread emails, categorize by priority, and generate an actionable briefing you can scan in 2 minutes.

## When to Use

- "What's in my inbox today?"
- "Summarize my unread emails"
- "Give me a morning email briefing"

## Requirements

- **Google Cloud CLI** (`gcloud`) authenticated with Gmail API
- OAuth2 scopes: `gmail.readonly`
- `jq` for JSON parsing

## Workflow

### Step 1 — Authenticate

```bash
ACCESS_TOKEN=$(gcloud auth print-access-token)
```

### Step 2 — Fetch Unread Messages

```bash
# Get today's unread messages
TODAY=$(date '+%Y/%m/%d')
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://gmail.googleapis.com/gmail/v1/users/me/messages?q=is:unread+after:${TODAY}&maxResults=50" | \
  jq -r '.messages[].id' > /tmp/unread_ids.txt

COUNT=$(wc -l < /tmp/unread_ids.txt)
echo "Found $COUNT unread messages"
```

### Step 3 — Extract Message Metadata

For each message, pull sender, subject, snippet:

```bash
while read MSG_ID; do
  curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
    "https://gmail.googleapis.com/gmail/v1/users/me/messages/$MSG_ID?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date" | \
    jq '{
      id: .id,
      from: (.payload.headers[] | select(.name=="From") | .value),
      subject: (.payload.headers[] | select(.name=="Subject") | .value),
      date: (.payload.headers[] | select(.name=="Date") | .value),
      snippet: .snippet,
      labels: .labelIds
    }'
done < /tmp/unread_ids.txt > /tmp/inbox_data.json
```

### Step 4 — Categorize by Priority

Classify each email:

| Priority | Criteria | Action |
|----------|----------|--------|
| 🔴 **Urgent** | From known contacts, contains "urgent/asap/deadline", calendar invites | Read & respond today |
| 🟡 **Important** | From colleagues/clients, project-related, requires response | Respond within 24h |
| 🔵 **FYI** | CC'd, newsletters you read, informational updates | Scan when free |
| ⚪ **Low** | Marketing, automated notifications, social media alerts | Batch process or archive |

### Step 5 — Generate Briefing

Create a structured briefing saved to `outputs/YYYY/MM/YYYY-MM-DD-inbox-briefing.md`:

```markdown
# Inbox Briefing — {DATE}

**Total unread: {COUNT}** | 🔴 {N} urgent | 🟡 {N} important | 🔵 {N} FYI | ⚪ {N} low

## 🔴 Urgent — Respond Now
1. **[Subject]** from [Sender] — [One-line summary of snippet]
2. ...

## 🟡 Important — Respond Today
1. **[Subject]** from [Sender] — [One-line summary]

## 🔵 FYI — Read When Free
1. **[Subject]** from [Sender] — [One-line summary]

## ⚪ Low Priority — Consider Archiving
1. **[Subject]** from [Sender]

## Suggested Actions
- Reply to {PERSON} about {TOPIC} (urgent, sent 3 hours ago)
- Review {DOCUMENT} shared by {PERSON}
- Archive {N} notification emails
```

### Step 6 — Present to User

Display the briefing and ask if they want to:
- Open any specific email thread
- Batch-archive the low priority items
- Draft a quick reply to any urgent item

## Important Rules

- Read-only — never modify, archive, or delete messages without user confirmation
- Summarize snippets, don't expose full email bodies unless asked
- Respect privacy of sensitive email content

## Example Prompts

- "What's in my inbox?"
- "Give me my morning email briefing"
- "Summarize unread emails from the last 3 days"
#gmail#productivity#summary#google-cligcloudcurljq