← Back to Directory
šŸ“§

Inbox Zero Agent

Automatically categorize emails, draft responses, track follow-ups, and keep your inbox at zero

šŸ¤– 0 ↑ 0 ↓ Ā |Ā  šŸ‘¤ 0 ↑ 0 ↓
intermediateā± 40 minutesšŸ”„ 8 swappable alternatives

šŸ§‚ Ingredients

šŸ”Œ APIs

read_emails_create_drafts_apply_labels_send_messages

šŸ”„ Alternatives:

Outlook — Microsoft ecosystem integrationSendgrid — Transactional email at scaleMailgun — Developer-friendly email API

alerts_for_urgent_emails_and_follow_up_reminders

šŸ”„ Alternatives:

Ntfy — Free, open-source push notificationsTelegram — Free push via TelegramSlack — Team notification channel

track_follow_up_status_and_response_times

šŸ”„ Alternatives:

Airtable — Better for structured data + APINotion Databases — More flexible views

šŸ“‹ Step-by-Step Build Guide

STEP 1

Connect to Gmail API with read/write/labels scopes

1. Connect to Gmail API with read/write/labels scopes

Connect to Gmail API with read/write/labels scopes

Steps:
1. Validate all required inputs are available
2. Execute the operation described above
3. Verify the result meets expected output format
4. Handle errors gracefully — retry transient failures, log and alert on persistent ones
5. Return structured output with status and any relevant data

If any required data is missing, request it from the user before proceeding.

šŸ§‘ Human Required

  • • ## Connect the API 1. Sign up for the service if you don't have an account 2. Find the API settings in your account dashboard 3. Generate an API key or access token 4. Share the key with your agent when prompted šŸ’” Most services have a free tier that's sufficient to get started.
STEP 2

Pull unread emails and classify each into categories

2. Pull unread emails and classify each into categories: Action Required, FYI, Newsletter, Automated/Receipts, Spam

Fetch unread emails from Gmail using the Gmail API.

GET https://gmail.googleapis.com/gmail/v1/users/me/messages?q=is:unread&maxResults=20

For each message, GET the full message to extract: sender, subject, date, snippet.
Classify each email:
- šŸ”“ Urgent: needs reply today (from known contacts, contains "urgent", "ASAP", time-sensitive)
- 🟔 Action Required: needs a response but not time-critical
- šŸ”µ FYI: newsletters, notifications, CC'd threads
- ⚪ Low Priority: automated receipts, marketing

Return: total unread count, then the top 5 by urgency with sender, subject, and classification.
STEP 3

Apply Gmail labels automatically based on classification

3. Apply Gmail labels automatically based on classification

Apply Gmail labels automatically based on classification

Steps:
1. Validate all required inputs are available
2. Execute the operation described above
3. Verify the result meets expected output format
4. Handle errors gracefully — retry transient failures, log and alert on persistent ones
5. Return structured output with status and any relevant data

If any required data is missing, request it from the user before proceeding.
STEP 4

For routine emails (meeting confirmations, simple questions), auto

4. For routine emails (meeting confirmations, simple questions), auto-draft a response

Generate a draft response based on the context.

Guidelines:
- Match the tone of the original message (formal → formal, casual → casual)
- Keep it concise — aim for 2-4 sentences for routine responses
- Include specific references to the original message
- End with a clear next step or call to action
- Don't make commitments or promises on behalf of the user

Mark the draft clearly: "[DRAFT — Review before sending]"
Include a confidence score: High (routine/clear intent), Medium (judgment call), Low (complex/sensitive).

For Low confidence drafts, explain what needs human judgment.
STEP 5

For emails you've sent that haven't received a reply in 3+ days, create a follow

5. For emails you've sent that haven't received a reply in 3+ days, create a follow-up reminder

For emails you've sent that haven't received a reply in 3+ days, create a follow-up reminder

Steps:
1. Validate all required inputs are available
2. Execute the operation described above
3. Verify the result meets expected output format
4. Handle errors gracefully — retry transient failures, log and alert on persistent ones
5. Return structured output with status and any relevant data

If any required data is missing, request it from the user before proceeding.
STEP 6

Daily at 8am

6. Daily at 8am: send an inbox summary — X unread, Y need action, Z follow-ups pending

Daily at 8am: send an inbox summary — X unread, Y need action, Z follow-ups pending

Steps:
1. Validate all required inputs are available
2. Execute the operation described above
3. Verify the result meets expected output format
4. Handle errors gracefully — retry transient failures, log and alert on persistent ones
5. Return structured output with status and any relevant data

If any required data is missing, request it from the user before proceeding.
STEP 7

Track response times and flag any emails unanswered for >48h

7. Track response times and flag any emails unanswered for >48h

Track response times and flag any emails unanswered for >48h

Steps:
1. Validate all required inputs are available
2. Execute the operation described above
3. Verify the result meets expected output format
4. Handle errors gracefully — retry transient failures, log and alert on persistent ones
5. Return structured output with status and any relevant data

If any required data is missing, request it from the user before proceeding.
STEP 8

Weekly

8. Weekly: inbox analytics — emails received, response rate, average response time, top senders

Send the compiled content via email using the configured email API.

Compose the email:
- To: {recipient_email}
- Subject: {subject_line}
- Body: Format as clean HTML with proper headings, bullet points, and styling.
  Use inline CSS for compatibility. Keep it mobile-friendly (max-width: 600px).

Send via the configured email provider (SendGrid, Resend, or SES).
Verify the response indicates successful delivery (202 for SendGrid, 200 for Resend).
Log: timestamp, recipient, subject, and delivery status.

If send fails, retry once after 3 seconds. If it fails again, save the email content locally and alert the user.

šŸ¤– Example Agent Prompt

Connect to Gmail API with read/write/labels scopes

Steps:
1. Validate all required inputs are available
2. Execute the operation described above
3. Verify the result meets expected output format
4. Handle errors gracefully — retry transient failures, log and alert on persistent ones
5. Return structured output with status and any relevant data

If any required data is missing, request it from the user before proceeding.

Copy this prompt into your agent to get started.

šŸ“§ Inbox Zero Agent — PincerAPI Cookbook