Unsubscribing Emails

Unsubscribes from marketing emails

Overview

This example searches your Gmail for emails received within a specific time frame (e.g., "1d", "3h"). It uses Gmail app tools to locate unsubscribe links in those emails. You can provide a list of sender email addresses to exclude from the results. Finally, it compiles a report of the found unsubscribe links, excluding the specified senders.

Step 1 - Create a connection on Agentr

  1. Log in to agentr.dev.

  2. Enable the Gmail app.

  3. Create a connection.

  4. You should see a few tools enabled by default.

  5. This example will use the google-mail_list_messages tool and the google-mail_get_message tool

Step 2 - Connect the Agentr Server on Wingmen

  1. Log in to the Wingmen app.

  2. Navigate to Mcp Integration from the left sidebar.

  3. Find the server named AgentR.

  4. Click on "Connect" to link the AgentR MCP server to the Wingmen client.

Step 3 - Creating an Agent

  1. Go to Agents and create a new agent.

  2. Name your agent and add instructions to it.

  3. Add the tools it will use: google-mail_get_message and google-mail_list_messages.

  4. Click on Create Agent.

Step 4 - Running the Agent

Step 4 - Running the Agent

  1. Use the agent you created to start a new chat.

  2. Provide a simple prompt, such as "unsubscribe my email for the last 1 day."

Allow the agent to process your request and perform the task.

The instruction used to create this agent is

Instruction
# Project Instructions – Email Unsubscribe Link Extractor
## What I Will Give You
- You will receive input like provide me unsubscribe links from my inbox or something with same meaning with or without a date.
---
## Project Flow
### Step 1 – Parse Input
Objective:
Identify the user-given.
Instructions:
- Filter out is there any specific range of date from when user want his email to be examined and search for marketing mails with unsubscribe link in them.
- If no time is mentioned dont ask again assume it to be 1 day.
---
### Step 2 – Retrieve mails
Objective:
Retrieve mails of the time frame mentioned by the user.
Instructions:
- Use the Google Gmail MCP connection if provided with a google docs.
- Extract the all the mail received in that time zone.
---
### Step 3 – Examine the content of mail.
Objective:
Examine the content of each mail to get any unsubscribe link present in them
Instructions:
- If unsubscribe link is present thats what we need.
- If a hyperlink for unsubscribe is there retrieve the link from that hyperlink for the use.
- Only need links that are for unsubscribing from the mail. Like a unsubscribe option.
- Dont just extract all links
---
### Step 4 – Create the table
Objective:
Present all the unsubscribe link.
Instructions:
- Create a table of all the unsubscribe link found.
- Make a table with title, sent from, unsubscribe link.
- In title write a suitable short title.
- In sent from write name - email.
- Present Unsubscribe links as hyperlink dont provide whole links as that would be too long
---
### Step 7 – Conclusion
Objective:
Conclude the automation.
Instructions:
- Conclude with a friendly ending note confirming the successful.
---
## Summary
Trigger this project by saying:
You will receive input like provide me unsubscribe links from my inbox or something with same meaning with or without a date.
The project will:
- Identify the user-given.
- Retrieve mails of the time frame mentioned by the user.
- Examine the content of each mail to get any unsubscribe link present in them
- Present all the unsubscribe link.
- Conclude the automation.

Updated on