Inbox Scanner
Checks email, LinkedIn, and Instagram inboxes for replies to outreach messages. Matches responses against the CRM outreach log to provide full lead context. Used by the evening-scan playbook as the first step before reply-analyzer.
Prerequisites
agency.config.json at repo root with tools.email_sending, tools.linkedin_outreach, tools.instagram_outreach
crm-writer skill for matching responses to CRM leads
- For browser path: Chrome DevTools MCP available (
mcp__chrome-devtools__*)
- Chrome Beta logged in: Zoho webmail, LinkedIn, Instagram
Phase 0: Intake
- Read
agency.config.json from the project root.
- Extract:
tools.email_sending -- provider, access method, domains
tools.linkedin_outreach -- provider, access method
tools.instagram_outreach -- provider, access method
tools.browser_automation -- Chrome DevTools MCP config
tools.inbox_scanning -- inbox scanning config
crm.tabs.outreach_log -- tab name for matching replies to sent outreach
crm.tabs.pipeline -- tab name for lead pipeline data
- Accept parameters:
channels -- list of channels to check (default: ["email", "linkedin", "instagram"], i.e., all)
time_window -- how far back to scan (default: "24h")
Phase 1: Check Email
Chrome DevTools MCP (Zoho webmail)
Use Chrome DevTools MCP to scan Zoho webmail inbox:
mcp__chrome-devtools__navigate_page to Zoho webmail inbox
mcp__chrome-devtools__wait_for inbox to load
mcp__chrome-devtools__take_snapshot to read recent emails
- Look for replies to outreach emails (matching subject lines, sender addresses)
- For each reply:
mcp__chrome-devtools__click to open the email
mcp__chrome-devtools__take_snapshot to read reply content
- Extract: sender name, sender email, subject, reply text, timestamp
Backup: Gmail MCP
If Chrome DevTools MCP is unavailable for Zoho, fall back to Gmail MCP:
- Search Gmail for replies (last 24 hours)
- Use BODY.PEEK[] to preserve read/unread status
API Path (access: "api")
For Smartlead, Instantly, or other email platforms with API access:
- Query the platform's campaign reply endpoint using the API key from the env var specified in
tools.email_sending.api_key_env.
- For Smartlead:
GET /api/v1/campaigns/{id}/replies
- For Instantly:
GET /api/v1/campaign/replies
- Filter by
time_window.
- Extract: sender name, sender email, reply text, campaign name, timestamp.
Manual Path (access: "manual")
Ask the user directly:
Any email replies since the last scan?
Paste them here, or list the companies/contacts that responded.
Format: Company Name - Contact Name - brief summary of their reply
Collect and structure whatever the user provides.
Phase 2: Check LinkedIn
Chrome DevTools MCP
mcp__chrome-devtools__navigate_page to https://www.linkedin.com/messaging/
mcp__chrome-devtools__wait_for messaging inbox to load
mcp__chrome-devtools__take_snapshot to read recent messages
- For each new message from an outreach contact:
- Extract: sender name, sender headline/company, message text, timestamp
- Check connection request acceptances:
mcp__chrome-devtools__navigate_page to https://www.linkedin.com/mynetwork/invitation-manager/sent/
mcp__chrome-devtools__take_snapshot to read accepted requests
Manual Path (access: "manual")
Ask the user:
Any LinkedIn responses since the last scan?
- New messages from outreach contacts?
- Connection requests accepted?
Format: Name - Company - what they said (or just "accepted connection")
Phase 3: Check Instagram
Chrome DevTools MCP
mcp__chrome-devtools__navigate_page to https://www.instagram.com/direct/inbox/
mcp__chrome-devtools__wait_for DM inbox to load
mcp__chrome-devtools__take_snapshot to read recent DMs
- For each new DM from an outreach contact:
- Extract: sender username, sender display name, message text, timestamp
- Skip: story reactions, emoji-only replies, automated responses
Manual Path (access: "manual")
Ask the user:
Any Instagram DM replies since the last scan?
Format: @username (Company) - what they said
Phase 4: Match to CRM
For each response found across all channels:
- Use
crm-writer (READ operation) to query the outreach log tab (crm.tabs.outreach_log).
- Match the response to an existing lead using these strategies (in order of reliability):
- Email address (exact match) -- most reliable for email replies
- Company name (fuzzy match, case-insensitive, strip Ltd/Inc/LLC) -- for LinkedIn/Instagram where email may not be visible
- Contact name (fuzzy match) -- fallback, combine with company for higher confidence
- For each matched lead, pull context from the CRM:
cadence_day -- which day in the outreach cadence they are on
last_action -- what was the last outreach action (e.g., "EMAIL_1", "LINKEDIN_CONNECT")
lead_status -- current status (e.g., "CONTACTED", "FOLLOW_UP")
tier -- lead tier/temperature (e.g., "HOT", "WARM", "COLD")
score -- lead score if available
- If no CRM match is found:
- Mark
crm_match as null
- Flag as "unmatched response" for manual review
- Still include in the output
Phase 5: Output
Return a structured JSON array of all responses found:
[
{
"channel": "email",
"from_name": "Sarah Chen",
"from_email": "sarah@brandx.com",
"company": "Brand X",
"reply_text": "Hey, this sounds interesting. What are your rates for a CRO audit?",
"timestamp": "2024-01-15T14:30:00Z",
"thread_subject": "Re: Quick question about your Shopify store",
"crm_match": {
"lead_id": "row_42",
"cadence_day": 4,
"last_action": "EMAIL_2",
"lead_status": "CONTACTED",
"tier": "HOT",
"score": 72
}
},
{
"channel": "linkedin",
"from_name": "Rahul Kapoor",
"from_email": null,
"company": "FreshFit Foods",
"reply_text": "Thanks for connecting! Yes, we are actually looking at revamping our Shopify store.",
"timestamp": "2024-01-15T11:20:00Z",
"thread_subject": null,
"crm_match": {
"lead_id": "row_67",
"cadence_day": 2,
"last_action": "LINKEDIN_CONNECT",
"lead_status": "CONTACTED",
"tier": "WARM",
"score": 55
}
},
{
"channel": "instagram",
"from_name": "Active Gear",
"from_email": null,
"company": "Active Gear",
"reply_text": "Not interested right now, thanks.",
"timestamp": "2024-01-15T16:45:00Z",
"thread_subject": null,
"crm_match": null
}
]
Print a summary line:
Inbox Scan Complete (last 24h):
- Email replies: 3
- LinkedIn messages: 1
- LinkedIn connections accepted: 2
- Instagram DM replies: 1
- Total responses: 7
- Matched to CRM leads: 5
- Unmatched (manual review needed): 2
Example Usage
Trigger phrases:
- "Check inboxes for replies"
- "Scan all channels for responses"
- "Any replies today?"
- "Run inbox scanner"
- "Check email and LinkedIn for responses"
User: Check all inboxes for replies
Assistant: [reads config, checks Zoho webmail via Chrome DevTools MCP, checks LinkedIn via Chrome DevTools MCP, checks Instagram via Chrome DevTools MCP, matches all replies to CRM leads, returns structured array with summary]
User: Just check email, skip LinkedIn and Instagram
Assistant: [same flow but channels=["email"] only]
1---2name: inbox-scanner3description: Check all outreach channels for replies using Chrome DevTools MCP. Scans Zoho webmail, LinkedIn messaging, and Instagram DMs.4---56# Inbox Scanner78Checks email, LinkedIn, and Instagram inboxes for replies to outreach messages. Matches responses against the CRM outreach log to provide full lead context. Used by the `evening-scan` playbook as the first step before `reply-analyzer`.910## Prerequisites1112- `agency.config.json` at repo root with `tools.email_sending`, `tools.linkedin_outreach`, `tools.instagram_outreach`13- `crm-writer` skill for matching responses to CRM leads14- For browser path: Chrome DevTools MCP available (`mcp__chrome-devtools__*`)15- Chrome Beta logged in: Zoho webmail, LinkedIn, Instagram1617## Phase 0: Intake18191. Read `agency.config.json` from the project root.202. Extract:21 - `tools.email_sending` -- provider, access method, domains22 - `tools.linkedin_outreach` -- provider, access method23 - `tools.instagram_outreach` -- provider, access method24 - `tools.browser_automation` -- Chrome DevTools MCP config25 - `tools.inbox_scanning` -- inbox scanning config26 - `crm.tabs.outreach_log` -- tab name for matching replies to sent outreach27 - `crm.tabs.pipeline` -- tab name for lead pipeline data283. Accept parameters:29 - `channels` -- list of channels to check (default: `["email", "linkedin", "instagram"]`, i.e., all)30 - `time_window` -- how far back to scan (default: `"24h"`)3132## Phase 1: Check Email3334### Chrome DevTools MCP (Zoho webmail)3536Use Chrome DevTools MCP to scan Zoho webmail inbox:37381. `mcp__chrome-devtools__navigate_page` to Zoho webmail inbox392. `mcp__chrome-devtools__wait_for` inbox to load403. `mcp__chrome-devtools__take_snapshot` to read recent emails414. Look for replies to outreach emails (matching subject lines, sender addresses)425. For each reply:43 - `mcp__chrome-devtools__click` to open the email44 - `mcp__chrome-devtools__take_snapshot` to read reply content45 - Extract: sender name, sender email, subject, reply text, timestamp4647### Backup: Gmail MCP4849If Chrome DevTools MCP is unavailable for Zoho, fall back to Gmail MCP:50- Search Gmail for replies (last 24 hours)51- Use BODY.PEEK[] to preserve read/unread status5253### API Path (access: "api")5455For Smartlead, Instantly, or other email platforms with API access:56571. Query the platform's campaign reply endpoint using the API key from the env var specified in `tools.email_sending.api_key_env`.582. For Smartlead: `GET /api/v1/campaigns/{id}/replies`593. For Instantly: `GET /api/v1/campaign/replies`604. Filter by `time_window`.615. Extract: sender name, sender email, reply text, campaign name, timestamp.6263### Manual Path (access: "manual")6465Ask the user directly:6667```68Any email replies since the last scan?69Paste them here, or list the companies/contacts that responded.70Format: Company Name - Contact Name - brief summary of their reply71```7273Collect and structure whatever the user provides.7475## Phase 2: Check LinkedIn7677### Chrome DevTools MCP78791. `mcp__chrome-devtools__navigate_page` to `https://www.linkedin.com/messaging/`802. `mcp__chrome-devtools__wait_for` messaging inbox to load813. `mcp__chrome-devtools__take_snapshot` to read recent messages824. For each new message from an outreach contact:83 - Extract: sender name, sender headline/company, message text, timestamp845. Check connection request acceptances:85 - `mcp__chrome-devtools__navigate_page` to `https://www.linkedin.com/mynetwork/invitation-manager/sent/`86 - `mcp__chrome-devtools__take_snapshot` to read accepted requests8788### Manual Path (access: "manual")8990Ask the user:9192```93Any LinkedIn responses since the last scan?94- New messages from outreach contacts?95- Connection requests accepted?96Format: Name - Company - what they said (or just "accepted connection")97```9899## Phase 3: Check Instagram100101### Chrome DevTools MCP1021031. `mcp__chrome-devtools__navigate_page` to `https://www.instagram.com/direct/inbox/`1042. `mcp__chrome-devtools__wait_for` DM inbox to load1053. `mcp__chrome-devtools__take_snapshot` to read recent DMs1064. For each new DM from an outreach contact:107 - Extract: sender username, sender display name, message text, timestamp1085. Skip: story reactions, emoji-only replies, automated responses109110### Manual Path (access: "manual")111112Ask the user:113114```115Any Instagram DM replies since the last scan?116Format: @username (Company) - what they said117```118119## Phase 4: Match to CRM120121For each response found across all channels:1221231. Use `crm-writer` (READ operation) to query the outreach log tab (`crm.tabs.outreach_log`).1242. Match the response to an existing lead using these strategies (in order of reliability):125 - **Email address** (exact match) -- most reliable for email replies126 - **Company name** (fuzzy match, case-insensitive, strip Ltd/Inc/LLC) -- for LinkedIn/Instagram where email may not be visible127 - **Contact name** (fuzzy match) -- fallback, combine with company for higher confidence1283. For each matched lead, pull context from the CRM:129 - `cadence_day` -- which day in the outreach cadence they are on130 - `last_action` -- what was the last outreach action (e.g., "EMAIL_1", "LINKEDIN_CONNECT")131 - `lead_status` -- current status (e.g., "CONTACTED", "FOLLOW_UP")132 - `tier` -- lead tier/temperature (e.g., "HOT", "WARM", "COLD")133 - `score` -- lead score if available1344. If no CRM match is found:135 - Mark `crm_match` as `null`136 - Flag as "unmatched response" for manual review137 - Still include in the output138139## Phase 5: Output140141Return a structured JSON array of all responses found:142143```json144[145 {146 "channel": "email",147 "from_name": "Sarah Chen",148 "from_email": "sarah@brandx.com",149 "company": "Brand X",150 "reply_text": "Hey, this sounds interesting. What are your rates for a CRO audit?",151 "timestamp": "2024-01-15T14:30:00Z",152 "thread_subject": "Re: Quick question about your Shopify store",153 "crm_match": {154 "lead_id": "row_42",155 "cadence_day": 4,156 "last_action": "EMAIL_2",157 "lead_status": "CONTACTED",158 "tier": "HOT",159 "score": 72160 }161 },162 {163 "channel": "linkedin",164 "from_name": "Rahul Kapoor",165 "from_email": null,166 "company": "FreshFit Foods",167 "reply_text": "Thanks for connecting! Yes, we are actually looking at revamping our Shopify store.",168 "timestamp": "2024-01-15T11:20:00Z",169 "thread_subject": null,170 "crm_match": {171 "lead_id": "row_67",172 "cadence_day": 2,173 "last_action": "LINKEDIN_CONNECT",174 "lead_status": "CONTACTED",175 "tier": "WARM",176 "score": 55177 }178 },179 {180 "channel": "instagram",181 "from_name": "Active Gear",182 "from_email": null,183 "company": "Active Gear",184 "reply_text": "Not interested right now, thanks.",185 "timestamp": "2024-01-15T16:45:00Z",186 "thread_subject": null,187 "crm_match": null188 }189]190```191192Print a summary line:193194```195Inbox Scan Complete (last 24h):196- Email replies: 3197- LinkedIn messages: 1198- LinkedIn connections accepted: 2199- Instagram DM replies: 1200- Total responses: 7201- Matched to CRM leads: 5202- Unmatched (manual review needed): 2203```204205## Example Usage206207Trigger phrases:208- "Check inboxes for replies"209- "Scan all channels for responses"210- "Any replies today?"211- "Run inbox scanner"212- "Check email and LinkedIn for responses"213214```215User: Check all inboxes for replies216Assistant: [reads config, checks Zoho webmail via Chrome DevTools MCP, checks LinkedIn via Chrome DevTools MCP, checks Instagram via Chrome DevTools MCP, matches all replies to CRM leads, returns structured array with summary]217```218219```220User: Just check email, skip LinkedIn and Instagram221Assistant: [same flow but channels=["email"] only]222```