# Gmail Smart Inbox: Filter, Draft Responses, and Discord Summary

> Searches Gmail for recent unread emails, cross-references senders against Google Contacts to filter out spam and automated messages, identifies important emails from real people, drafts and saves personalized responses in Gmail for each, then posts a formatted summary of all important emails and drafted responses to a Discord channel.

Content type: workflow
Source URL: https://www.agentpmt.com/agent-workflow-skills/gmail-search-and-discord-notification
Markdown URL: https://www.agentpmt.com/api/agent/workflows/gmail-search-and-discord-notification?format=agent-md
Updated: 2026-02-19T19:01:06.332Z
Author: firef1ie

---

Estimated time saved: 45 minutes.

## Tools

- Gmail - All Email Actions
- Google Contacts
- Post On Discord Channel

## Workflow Outline

1. Search Gmail for Unread Emails: Search Gmail for unread emails from the last day in the Primary category. This filters out Promotions, Social, Updates, and Forums tabs automatically. Return the full list of matc...
2. Fetch Google Contacts: Retrieve the user's Google Contacts list. This will be used to cross-reference against email senders to verify which emails come from known, real people versus unknown senders, ma...
3. Filter Spam and Prioritize Emails: Goal: Analyze the fetched emails and contacts list to separate important emails from real people versus spam, marketing, automated notifications, and bulk messages. Produce a prioritized list of emails that deserve a pe...
4. Process Each Important Email: Repeat this section for each email. Iterate over each important email identified in the previous filtering step. For each email, draft a personalized response and then save it...
5. Draft Personalized Response: Goal: Draft a thoughtful, personalized email response for the current email that matches the tone and context of the original message. | Inputs: The current email object including: sender name, sender email, subject lin...
6. Compose Discord Summary: Goal: Create a well-formatted Discord message summarizing all important emails received and the draft responses that were saved in Gmail. | Inputs: The complete list of processed important emails with: sender info, subj...
7. Save Draft in Gmail: Save the drafted response as a Gmail draft. Use the recipient email address, reply subject line, and response body from the previous drafting step. The draft should be saved so th...
8. Post Summary to Discord: Use Discord Webhook URL:{ENTER YOUR URL HERE} Post the formatted email summary to the configured Discord channel. The message should use the markdown-formatted summary from the pr...

## Frequently Asked Questions

### How do I connect this workflow to my local agent like OpenClaw or Claude Code?

You can install the local MCP server by opening a terminal and running:

```
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

This will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.

Alternatively you can connect to the hosted version with this config block, no installation required:

```
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}
```

[View MCP Connection Instructions](/docs/mcp-reference/connection) for more details.

### How do I trigger this workflow?

You can use it here in the browser by clicking the 'Try It' button.

If you 'star' the workflow it will save to your dashboard for quick access.

To use the workflow in an external agent, make sure you have followed the steps to connect it to the MCP server and then copy / paste this prompt, or just tell it to use the AgentPMT MCP server and use this workflow.

> Call the AgentPMT-Workflow-Skills tool with action 'get\_workflow\_skill' and skill\_id 6978484bd310638f00fad671 ("Gmail Smart Inbox: Filter, Draft Responses, and Discord Summary").