SOP: Email Client Communications (CLI First, MCP Fallback)
Title: Email Client Communications
Version: 1.0
Date: 2026-03-11
Owner: Engineering / Delivery
1. Purpose
Standardize how agents run client communication workflows that involve Gmail and Calendar:
- Search client email context
- Draft client follow-up emails
- Prepare or update client meeting events
The default execution path is gws CLI first, with Google Workspace MCP as fallback.
2. Scope
Applies to Brainforge internal agent workflows and commands in this repo.
Does not apply to product runtime code in apps/.
3. Prerequisites
gwsis installed and authenticated (preferred):gws auth status
- If CLI is unavailable, Google Workspace MCP is configured:
standards/01-onboarding/setup-google-workspace-mcp.md
- Follow communication standards:
standards/02-writing/Communications/email-communication-standards.md
4. Execution flow
Step 1 — Clarify input
Collect minimum required inputs:
- Client name
- Objective (search context, draft follow-up, calendar update)
- Time window (default 14 days for email context unless user specifies)
Optional:
- Client domain(s) or specific sender address
- Relevant topic keyword(s)
Step 2 — Run via CLI first
2a) Email context query (Gmail)
Build a Gmail query, then list messages:
gws gmail users messages list --params '{"userId":"me","q":"from:client@domain.com newer_than:14d","maxResults":20}'Retrieve key messages by ID:
gws gmail users messages get --params '{"userId":"me","id":"MESSAGE_ID"}'2b) Calendar context query
Search upcoming/past events for the client:
gws calendar events list --params '{"calendarId":"primary","q":"LMNT","singleEvents":true,"orderBy":"startTime","timeMin":"2026-03-01T00:00:00Z","timeMax":"2026-03-31T23:59:59Z"}'Step 3 — MCP fallback (when needed)
Use Google Workspace MCP if CLI is unavailable or unsuitable.
- Use the current user’s Google identity for
user_google_emailby default. - Do not ask for a different email unless the user explicitly requests it.
Step 4 — Synthesize output
For context requests, produce:
- Query used
- Key threads/messages
- Decisions and open loops
- Recommended next reply or follow-up actions
For draft requests, produce:
- Subject line
- Email body draft
- Optional variants (short / detailed)
Always apply:
standards/02-writing/Communications/email-communication-standards.mdstandards/02-writing/Communications/email-update-template.md(if update-style email)
Step 5 — Finalization guardrails
- Do not auto-send email unless user explicitly asks.
- If a calendar invite is created/updated, enforce:
- Standard title format
- One canonical meeting link
- Provide output in chat first.
- Ask if the user wants a markdown file saved.
5. Output format (default)
## Client Email Context: [Client]
- Time window: [...]
- Query used: [...]
### Key threads
- [...]
### Open loops
- [...]
### Suggested next reply
Subject: [...]
Body:
...6. Quality checks
- CLI-first path attempted before MCP fallback
- Query/time window explicitly shown
- No fabricated messages or events
- Draft follows subject/body standards
- Calendar naming/link standards enforced
- Chat-first output provided
7. Related skills and commands
.cursor/skills/email-client-context/SKILL.md.cursor/skills/email-client-follow-up/SKILL.md.cursor/commands/client-email-context.md.cursor/commands/draft-client-follow-up-email.md