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
Array of alert rule configurations
integer
Alert rule ID
string
Rule name
string
Human-readable description
boolean
Whether rule is active
string
Entity to monitor:
agent, task, session, or activitystring
Field to evaluate (e.g.,
status, priority, assigned_to)string
Comparison operator:
equals, not_equals, greater_than, less_than, contains, count_above, count_below, age_minutes_abovestring
Value to compare against
string
Action to take when triggered (default:
notification)object
Configuration for the action (e.g.,
{"recipient": "admin"})integer
Minimum time between triggers (default: 60 minutes)
integer
Unix timestamp of last trigger (null if never triggered)
integer
Total number of times this rule has triggered
string
Username who created the rule
integer
Unix timestamp
Create Alert Rule
Request Body
string
required
Rule name for identification
string
Human-readable description of the rule
string
required
Entity to monitor:
agent- Monitor agent status, activitytask- Monitor task status, priority, assignmentssession- Monitor gateway sessionsactivity- Monitor activity log entries
string
required
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
string
required
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
string
required
Value to compare against (stringified)
string
default:"notification"
Action to take when rule triggers
object
Configuration for the action. For notifications:
{"recipient": "username"}integer
default:60
Minimum minutes between rule triggers (prevents spam)
Response
object
Created alert rule object (see List response for schema)
Update Alert Rule
Request Body
integer
required
Alert rule ID to update
string
New rule name
string
New description
boolean
Enable or disable rule
string
Update entity type
string
Update field to monitor
string
Update comparison operator
string
Update comparison value
string
Update action type
object
Update action configuration
integer
Update cooldown period
Delete Alert Rule
Request Body
integer
required
Alert rule ID to delete
Evaluate Rules Manually
Trigger immediate evaluation of all enabled alert rules.Request Body
string
required
Must be
evaluateResponse
integer
Number of rules evaluated
integer
Number of rules that triggered
array
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
Aggregate Operators
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)