API Health Monitor Skill
Turn a wall of HTTP probe results into a one-paragraph "what is broken and why" — clustered by region, service, or status code.
The Problem
When 4 of 22 endpoints fail, the question is rarely "which 4" — it is "what do they have in common?" A human eyes the list and spots the pattern in 5 seconds. AI does the same automatically and scales as you add endpoints.
How It Works
- A
runtimeenvtask hits each endpoint withcurland emits a JSON list of results - The
api-health-monitorskill clusters failures and identifies likely root causes - The
messagetask delivers the digest
Setup
- Install this skill
- Edit the endpoint list in the YAML below — name, region, service, URL per line
- Schedule for whatever cadence makes sense (5 minutes for canaries, 15 minutes for production)
Example YAML Job
name: api-health-check
version: 1.0.0
description: Multi-endpoint health probe with AI clustering
notifications:
- userNames: [intouch]
alertOnError: true
tasks:
- name: probe-endpoints
tool: runtimeenv
properties:
scriptContent: |
#!/bin/bash
endpoints=(
"checkout-api-us|us-east-1|checkout|https://api.example.com/checkout/health"
"checkout-api-eu|eu-west-1|checkout|https://eu.api.example.com/checkout/health"
"inventory-us|us-east-1|inventory|https://api.example.com/inv/health"
"inventory-eu|eu-west-1|inventory|https://eu.api.example.com/inv/health"
)
echo "["
first=1
for e in "${endpoints[@]}"; do
IFS='|' read -r name region service url <<< "$e"
[ $first -eq 0 ] && echo ","
first=0
result=$(curl -s -o /dev/null -w "%{http_code} %{time_total}" --max-time 10 "$url" || echo "000 -1")
read -r code t <<< "$result"
status=$([ "$code" = "000" ] && echo "TIMEOUT" || echo "$code")
ms=$(awk "BEGIN{printf \"%d\", $t*1000}")
printf ' {"name":"%s","region":"%s","service":"%s","url":"%s","status":"%s","responseTimeMs":%s}' \
"$name" "$region" "$service" "$url" "$status" "$ms"
done
echo
echo "]"
- name: digest
tool: skill
properties:
skillName: api-health-monitor
input: "{{probe-endpoints.output}}"
- name: send
tool: message
properties:
subject: "API health"
body: "{{digest.answer}}"
userNames: "intouch"
Customization
- Suppress on green — wrap the message task in a workflow tool that only fires when the digest does not begin with "all N endpoints healthy"
- Severity tiers — add a
tierfield per endpoint (canary, critical, internal) and prompt the skill to weight failures by tier - Cadence — every 1m for canary, 5m for prod, hourly for low priority
Cost
- AI assistant: ~$0.001 per check with Claude Haiku — at 5-minute cadence, ~$0.25/month