Alerts
Alert rules allow you to monitor Mission Control entities (agents, tasks, sessions, activities) and trigger notifications when specific conditions are met. Configure automated alerts for agent failures, stuck tasks, or unusual activity patterns.List Alert Rules
Response
Array of alert rule configurations
Alert rule ID
Rule name
Human-readable description
Whether rule is active
Entity to monitor:
agent, task, session, or activityField to evaluate (e.g.,
status, priority, assigned_to)Comparison operator:
equals, not_equals, greater_than, less_than, contains, count_above, count_below, age_minutes_aboveValue to compare against
Action to take when triggered (default:
notification)Configuration for the action (e.g.,
{"recipient": "admin"})Minimum time between triggers (default: 60 minutes)
Unix timestamp of last trigger (null if never triggered)
Total number of times this rule has triggered
Username who created the rule
Unix timestamp
Create Alert Rule
Request Body
Rule name for identification
Human-readable description of the rule
Entity to monitor:
agent- Monitor agent status, activitytask- Monitor task status, priority, assignmentssession- Monitor gateway sessionsactivity- Monitor activity log entries
Field to evaluate. Allowed fields per entity type:
- Agent:
status,role,name,last_seen,last_activity - Task:
status,priority,assigned_to,title - Activity:
type,actor,entity_type
Comparison operator:
equals- Exact matchnot_equals- Not equalgreater_than- Numeric comparisonless_than- Numeric comparisoncontains- Substring match (case-insensitive)count_above- Count of matching entities exceeds valuecount_below- Count of matching entities below valueage_minutes_above- Field timestamp older than N minutes
Value to compare against (stringified)
Action to take when rule triggers
Configuration for the action. For notifications:
{"recipient": "username"}Minimum minutes between rule triggers (prevents spam)
Response
Created alert rule object (see List response for schema)
Update Alert Rule
Request Body
Alert rule ID to update
New rule name
New description
Enable or disable rule
Update entity type
Update field to monitor
Update comparison operator
Update comparison value
Update action type
Update action configuration
Update cooldown period
Delete Alert Rule
Request Body
Alert rule ID to delete
Evaluate Rules Manually
Trigger immediate evaluation of all enabled alert rules.Request Body
Must be
evaluateResponse
Number of rules evaluated
Number of rules that triggered
Rule Examples
Alert on Agent Errors
Alert on High Priority Tasks
Alert on Too Many Tasks
Alert on Stale Agent Activity
Alert on Activity Spikes
The
count_above operator for activities checks the count in the last hour only.Condition Operators
Comparison Operators
| Operator | Description | Example |
|---|---|---|
equals | Exact match | status = "error" |
not_equals | Not equal | status != "online" |
greater_than | Numeric greater than | priority > 5 |
less_than | Numeric less than | estimated_hours less than 2 |
contains | Substring (case-insensitive) | title contains "urgent" |
Aggregate Operators
| Operator | Description | Example |
|---|---|---|
count_above | Count exceeds value | Count of offline agents > 3 |
count_below | Count below value | Count of in-progress tasks < 5 |
age_minutes_above | Field timestamp older than N minutes | last_seen > 30 minutes ago |
Cooldown Behavior
Cooldown prevents alert spam:- Rule triggers → creates notification
last_triggered_attimestamp is set- Rule cannot trigger again until
cooldown_minuteselapses - During cooldown, evaluation returns
"In cooldown"
cooldown_minutes: 60 can only trigger once per hour, even if the condition remains true.
Notifications
When an alert rule triggers, a notification is created:/api/notificationsendpoint- Real-time SSE stream (
/api/events) - Mission Control dashboard UI
Automatic Evaluation
Alert rules are evaluated automatically by the scheduler:- Frequency: Every 5 minutes (configurable via
MC_ALERT_EVAL_INTERVAL) - Scope: All enabled rules across all workspaces
- Cooldown respected: Rules in cooldown are skipped
POST /api/alerts with {"action": "evaluate"}.
Security Considerations
- SQL Injection Protection: Only whitelisted columns are allowed in
condition_field - Role Requirements:
- Create/Update:
operatorrole - Delete:
adminrole - List/Evaluate:
viewerrole
- Create/Update:
- Workspace Isolation: Rules only evaluate entities in their workspace
Best Practices
- Use appropriate cooldowns - Balance responsiveness vs. noise
- Test with evaluate - Manually trigger evaluation during setup
- Monitor trigger counts - High counts may indicate misconfigured rules
- Combine with webhooks - Use alerts + webhooks for external integrations
- Name descriptively - Use clear names like “Agent Offline > 30min”
Rate Limits
- Creation/updates: 100 requests/minute per API key
- Evaluation: Manual evaluation limited to 1 request/10 seconds
- Automatic evaluation: Every 5 minutes (not user-controlled)