Skip to content
All Skills

Gmail Follow-Up Tracker

Scans your Gmail sent folder for unanswered emails, identifies stale threads, and creates follow-up drafts with context-aware nudges via Google CLI. Prerequisites: gcloud, curl, jq.

Email & Communication|v1|Updated 5/18/2026
MCP get_skill({ skillId: "gmail-follow-up-tracker-c737e963" })

Use this skill with your agent

Create a free account and connect via MCP

Get Started Free
# Gmail Follow-Up Tracker

Scan your Gmail sent folder for emails without replies, identify stale threads, and auto-generate follow-up drafts.

## When to Use

- "Check which emails I haven't gotten replies to"
- "Create follow-ups for my unanswered emails from this week"
- "Nudge Sarah about the proposal I sent 5 days ago"

## Requirements

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

## Workflow

### Step 1 — Authenticate

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

### Step 2 — Find Unanswered Sent Emails

Query sent emails from the specified time window (default: last 7 days):

```bash
# Calculate date range
AFTER_DATE=$(date -d '7 days ago' '+%Y/%m/%d')

# Search sent emails
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://gmail.googleapis.com/gmail/v1/users/me/messages?q=in:sent+after:${AFTER_DATE}&maxResults=20" | \
  jq -r '.messages[].id'
```

### Step 3 — Check Each Thread for Replies

For each sent message, fetch its thread and check if anyone replied:

```bash
# Get message details
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://gmail.googleapis.com/gmail/v1/users/me/messages/{MSG_ID}?format=metadata&metadataHeaders=Subject&metadataHeaders=To&metadataHeaders=Date" | \
  jq '{id: .id, threadId: .threadId, subject: (.payload.headers[] | select(.name=="Subject") | .value), to: (.payload.headers[] | select(.name=="To") | .value), date: (.payload.headers[] | select(.name=="Date") | .value)}'

# Fetch the full thread
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://gmail.googleapis.com/gmail/v1/users/me/threads/{THREAD_ID}?format=metadata" | \
  jq '.messages | length'
```

If thread has only 1 message (the one you sent), it's **unanswered**.

### Step 4 — Build Stale Email Report

For each unanswered email, calculate days since sent and classify urgency:

| Days Stale | Urgency | Follow-Up Tone |
|------------|---------|----------------|
| 2-3 days | Low | Gentle check-in, add value |
| 4-7 days | Medium | Direct nudge, reference specific ask |
| 8-14 days | High | Final follow-up, suggest alternative |
| 14+ days | Cold | Re-introduce context, new angle |

Present the report as a table to the user.

### Step 5 — Generate Follow-Up Drafts

For each selected email, compose a follow-up that:
1. References the original email briefly (don't just say "following up")
2. Adds new value or context
3. Makes the ask clear and easy to respond to
4. Includes a soft deadline if appropriate
5. Is shorter than the original email

### Step 6 — Create Drafts in Gmail

For each approved follow-up:

```bash
# Create reply draft (uses threadId to attach to original thread)
ENCODED=$(echo -n "From: me\nTo: {RECIPIENT}\nSubject: Re: {SUBJECT}\nIn-Reply-To: {ORIGINAL_MSG_ID}\nReferences: {ORIGINAL_MSG_ID}\nContent-Type: text/plain; charset=utf-8\n\n{FOLLOW_UP_BODY}" | base64 -w 0 | tr '+/' '-_' | tr -d '=')

curl -s -X POST -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"message\": {\"raw\": \"$ENCODED\", \"threadId\": \"{THREAD_ID}\"}}" \
  "https://gmail.googleapis.com/gmail/v1/users/me/drafts"
```

## Important Rules

- Never send follow-ups directly — only create drafts
- Never sound passive-aggressive
- Always provide an easy out ("If this is no longer relevant, no worries")
- Match formality to the original email's tone

## Example Prompts

- "Check my unanswered emails from the past week"
- "Create a follow-up for the proposal I sent to john@acme.com"
- "Show me all stale threads and draft nudges"
#gmail#follow-up#google-cli#automationgcloudcurljq