Skip to content

sii_email_notification - Email Notification

Overview

The sii_email_notification tool sends important email notifications to authenticated users via SII. Only use when the user explicitly requests or indicates remote monitoring AND an important event occurs (critical failure, long-running job completed, or action required). Avoid frequent notifications. Include full context so the user needs no follow-up to understand the situation.

Tool Name

  • Internal Name: sii_email_notification
  • Display Name: SII Email Notification
  • Icon: Mail

Prerequisites

  1. SII Account: Valid SII account required
  2. User Authentication: Must be authenticated with SII
  3. User Authorization: User explicitly requested or indicated need for remote monitoring

Parameters

Required Parameters

ParameterTypeDescription
eventstringThe event that triggers the notification. Email will be sent only when preconditions are satisfied. Options: "critical_failure", "long_running_completed", "need_user_action"

Optional Parameters

ParameterTypeDefaultDescription
user_requestedboolean-Whether the user explicitly requested an email notification for this task/session
user_remote_monitoringboolean-Whether the user indicated they are away and need remote monitoring notifications
subjectstring-Optional email subject. If omitted, a suitable subject will be generated from the event
sender_namestring"SII CLI Agent"Optional sender display name
backgroundstring-Background and cause
current_statusstring-Current state
result_summarystring-Result summary (success/failure and key metrics)
errorsstring[]-Specific error details if any
next_stepsstring[]-Suggested next actions for the user (if applicable)
raw_contentstring-Optional raw content to embed directly into the email. If provided, structured fields are ignored

Event Types

1. Critical Failure

  • Use Case: System or task encounters serious error
  • Examples: Deployment failure, database connection lost, critical service crash, security vulnerability detected

2. Long Running Completed

  • Use Case: Long-running task completes
  • Examples: Large build completed, data migration finished, batch processing done, test suite run completed

3. Need User Action

  • Use Case: Requires user intervention or decision
  • Examples: Deployment approval needed, configuration conflict to resolve, resource limits to adjust, manual verification required

When to Use

Should Use

  1. User Explicitly Requests: "Email me when done", "Notify me if there's an error"
  2. User Indicates Remote Monitoring: "I'll be away, notify me if there are issues"
  3. Important Event Occurs: Critical failure, long task completion, user action needed

Should NOT Use

  1. Regular operation completion
  2. Non-critical information
  3. Frequent status updates
  4. Unauthorized notifications

Usage Examples

Critical Failure Notification

json
{
  "event": "critical_failure",
  "user_requested": true,
  "subject": "Deployment Failed - Immediate Action Required",
  "background": "Attempted to deploy application to production environment",
  "current_status": "Deployment failed, service not updated",
  "result_summary": "Encountered database migration error during deployment",
  "errors": [
    "Database migration failed: table 'users' already exists",
    "Rollback successful, service remains on old version"
  ],
  "next_steps": [
    "Check database migration scripts",
    "Manually resolve table conflict",
    "Re-run deployment"
  ]
}

Long Running Task Completed

json
{
  "event": "long_running_completed",
  "user_remote_monitoring": true,
  "subject": "Data Migration Completed",
  "background": "Migrating 1 million records from old database to new system",
  "current_status": "Migration successfully completed",
  "result_summary": "Successfully migrated 1,000,000 records in 2 hours 15 minutes",
  "next_steps": [
    "Verify data integrity",
    "Update application config to point to new database",
    "Monitor new system performance"
  ]
}

Need User Action

json
{
  "event": "need_user_action",
  "user_requested": true,
  "subject": "Production Deployment Approval Required",
  "background": "All tests passed, ready to deploy to production",
  "current_status": "Awaiting user approval",
  "result_summary": "Test pass rate: 100%, performance tests met targets",
  "next_steps": [
    "Review changelog",
    "Approve deployment",
    "Or postpone to maintenance window"
  ]
}

Return Value

The tool returns an object containing:

  • llmContent: Confirmation message
  • returnDisplay: User-friendly display information
  • summary: Operation summary
  • email_sent: Whether email was successfully sent

Best Practices

  1. Provide Full Context: Include enough information for user to understand without follow-up
  2. Clear Subject: Concise, includes key information, indicates urgency
  3. Actionable Suggestions: Provide specific next steps with relevant links or commands
  4. Avoid Frequent Notifications: Only send important notifications, respect user preferences
  5. Verify Preconditions: Confirm user authorization, check event importance

Notification Strategy

When to Send

  • ✅ Critical system failures
  • ✅ Long-running tasks completed (>30 minutes)
  • ✅ Urgent decisions needed
  • ✅ User explicitly requested

When NOT to Send

  • ❌ Regular operation completion
  • ❌ Informational messages
  • ❌ Frequent status updates
  • ❌ Non-critical warnings
  • run_shell_command: Execute commands
  • sii_deep_research: Deep research
  • save_memory: Save user preferences

Released under the MIT License.