Email Triage Actions
Overview
Turn a scoped review into explicit provider actions with per-message receipts.
The plan is a human-readable preview; mail_action itself has no dry-run flag,
so do not call it until the user confirms the exact operation and messages.
Prerequisites
- Run IntentMail on Node.js 20 or newer.
- Connect the target Gmail or Outlook account through IntentMail OAuth.
- Configure an AI provider before requesting draft generation.
Authentication and privacy
- Require an account connected through
mail_auth_start; never request OAuth
credentials or AI keys in chat.
- Provider actions use the user's Gmail or Microsoft Graph token. OAuth tokens
and the cache remain local.
- Cloud AI providers receive content supplied for draft generation; Ollama can
keep inference local. No send tool is permitted by this skill.
- See the action safety contract.
Workflow
- Call
mcp__intentmail__mail_daily_digest only when candidates were not
already supplied. Bound the account, time window, and item count.
- Present a plan containing each local email ID, subject, requested operation,
provider effect, local effect, and known reversal. Do not hide bulk scope
behind phrases such as "clean everything".
- Obtain explicit confirmation for that exact plan. Any changed scope or
operation requires a new confirmation.
- For mark-read/unread, archive, flag/unflag, or move, call
mcp__intentmail__mail_action one message at a time and record newState.
- For a reply, call
mcp__intentmail__mail_draft. It generates draft text;
it does not create a Gmail/Outlook draft and cannot send. Return the text
for user review without implying it was saved remotely.
- For deletion requests, call
mcp__intentmail__mail_stage_delete with
backupMime: true, review via mcp__intentmail__mail_list_staged, and stop.
Staging is local only. Permanent provider deletion is not implemented or
permitted in this skill. Use mcp__intentmail__mail_unstage to cancel.
- Report individual successes and failures. Never retry a provider mutation
blindly when the result is ambiguous.
Approval boundaries
- Read: a digest may be built within the user's stated scope.
- Confirm once per exact plan: mark state, archive, flag, or move actions.
- Confirm before local staging: show every message selected for staging.
- Not permitted: sending mail, committing local deletions, provider
deletion, bulk scope expansion, or claiming an audit/rollback receipt that
direct actions do not produce.
Validation
- Match every result's email ID and operation to the approved plan.
- Treat
success plus the returned newState as the receipt for direct
actions; do not claim all direct actions are in the rule audit log.
- Verify generated draft text contains no invented recipients, commitments, or
attachments before returning it.
- Verify staged count and IDs with
mail_list_staged; never equate staging with
provider deletion.
Output
Return the approved scope, operation per message, provider/local effect,
newState receipts, draft text awaiting review, staged IDs and retention,
failures, ambiguous outcomes, and any manual provider-side step still required.
Error Handling
- Not authenticated: stop and direct the user to the explicit OAuth flow.
- Ambiguous or partial provider result: stop that item and report it; do not
assume the mutation failed or succeeded.
- Unsupported send/delete/unsubscribe request: explain the current boundary.
The consolidated tool's
unsubscribe operation only archives today, so this
skill does not represent it as an unsubscribe.
- Bad draft: discard the output and ask for corrected facts or tone; never
send or claim a provider draft exists.
- Wrong staged item: unstage it before doing anything else.
Examples
For account 1, show the five newsletters you propose to archive. Wait for my
confirmation, then archive them one at a time and report each newState.
Generate reply text for email 42 in a concise professional tone. Do not save or
send it. Return the draft and any uncertain facts for my review.
Resources
- Action safety contract
- Provider action implementation:
src/connectors/email-actions.ts
- Deletion staging:
src/storage/services/deletion-staging.ts
1---2name: email-triage-actions3description: Review and execute bounded Gmail or Outlook actions through IntentMail, including read state, archive, flag, move, draft-text generation, and local deletion staging. Use when acting on selected inbox items; trigger with "archive these", "flag for follow-up", "draft replies", or "clean my inbox".4license: Apache-2.05---67# Email Triage Actions89## Overview1011Turn a scoped review into explicit provider actions with per-message receipts.12The plan is a human-readable preview; `mail_action` itself has no dry-run flag,13so do not call it until the user confirms the exact operation and messages.1415## Prerequisites1617- Run IntentMail on Node.js 20 or newer.18- Connect the target Gmail or Outlook account through IntentMail OAuth.19- Configure an AI provider before requesting draft generation.2021## Authentication and privacy2223- Require an account connected through `mail_auth_start`; never request OAuth24 credentials or AI keys in chat.25- Provider actions use the user's Gmail or Microsoft Graph token. OAuth tokens26 and the cache remain local.27- Cloud AI providers receive content supplied for draft generation; Ollama can28 keep inference local. No send tool is permitted by this skill.29- See the [action safety contract](references/action-safety.md).3031## Workflow32331. Call `mcp__intentmail__mail_daily_digest` only when candidates were not34 already supplied. Bound the account, time window, and item count.352. Present a plan containing each local email ID, subject, requested operation,36 provider effect, local effect, and known reversal. Do not hide bulk scope37 behind phrases such as "clean everything".383. Obtain explicit confirmation for that exact plan. Any changed scope or39 operation requires a new confirmation.404. For mark-read/unread, archive, flag/unflag, or move, call41 `mcp__intentmail__mail_action` one message at a time and record `newState`.425. For a reply, call `mcp__intentmail__mail_draft`. It generates draft text;43 it does not create a Gmail/Outlook draft and cannot send. Return the text44 for user review without implying it was saved remotely.456. For deletion requests, call `mcp__intentmail__mail_stage_delete` with46 `backupMime: true`, review via `mcp__intentmail__mail_list_staged`, and stop.47 Staging is local only. Permanent provider deletion is not implemented or48 permitted in this skill. Use `mcp__intentmail__mail_unstage` to cancel.497. Report individual successes and failures. Never retry a provider mutation50 blindly when the result is ambiguous.5152## Approval boundaries5354- **Read:** a digest may be built within the user's stated scope.55- **Confirm once per exact plan:** mark state, archive, flag, or move actions.56- **Confirm before local staging:** show every message selected for staging.57- **Not permitted:** sending mail, committing local deletions, provider58 deletion, bulk scope expansion, or claiming an audit/rollback receipt that59 direct actions do not produce.6061## Validation6263- Match every result's email ID and operation to the approved plan.64- Treat `success` plus the returned `newState` as the receipt for direct65 actions; do not claim all direct actions are in the rule audit log.66- Verify generated draft text contains no invented recipients, commitments, or67 attachments before returning it.68- Verify staged count and IDs with `mail_list_staged`; never equate staging with69 provider deletion.7071## Output7273Return the approved scope, operation per message, provider/local effect,74`newState` receipts, draft text awaiting review, staged IDs and retention,75failures, ambiguous outcomes, and any manual provider-side step still required.7677## Error Handling7879- **Not authenticated:** stop and direct the user to the explicit OAuth flow.80- **Ambiguous or partial provider result:** stop that item and report it; do not81 assume the mutation failed or succeeded.82- **Unsupported send/delete/unsubscribe request:** explain the current boundary.83 The consolidated tool's `unsubscribe` operation only archives today, so this84 skill does not represent it as an unsubscribe.85- **Bad draft:** discard the output and ask for corrected facts or tone; never86 send or claim a provider draft exists.87- **Wrong staged item:** unstage it before doing anything else.8889## Examples9091```text92For account 1, show the five newsletters you propose to archive. Wait for my93confirmation, then archive them one at a time and report each newState.94```9596```text97Generate reply text for email 42 in a concise professional tone. Do not save or98send it. Return the draft and any uncertain facts for my review.99```100101## Resources102103- [Action safety contract](references/action-safety.md)104- Provider action implementation: `src/connectors/email-actions.ts`105- Deletion staging: `src/storage/services/deletion-staging.ts`