1. Add a webhook to an alert group
In the dashboard, open the alert group and add a Webhook channel with the URL the agent listens on. Webhooks sit alongside email and Slack — an alert fans out to every channel in the group. The request is aPOST with Content-Type: application/json and a User-Agent of
Alertee-Webhook/1.0. Custom headers (for example an Authorization bearer token so your
endpoint can trust the call) are supported on the channel config.
2. The webhook payload
Every alert delivers this JSON body:
The payload intentionally carries metadata, not the SQL or the data. The agent fetches those
in the next step using
check_id.
3. Let the agent investigate over MCP
Connect your agent to the Alertee MCP server, then have it call two tools with thecheck_id from the webhook.
get_check — the definition
Returns the check’s full configuration, including the SQL it runs:
Query is the exact SQL — the agent can read it, reason about it, or run it against the
source database itself.
get_check_history — what’s been happening
Returns recent runs (default the last 24 hours; pass hours to widen the window):
Status and timestamps. Details holds the condition
evaluation (the value seen versus the threshold), and Results holds the query rows captured
for that run when available — so the agent can see not just that it failed but when it
started and by how much.
A sample agent prompt
An Alertee alert just fired. Here is the webhook payload:With{…}. Useget_checkto read the SQL andget_check_historyto see the last several runs, passing the payload’sorg_idasorganization_idso you read the right organization. Tell me when the failure started, whether it’s a spike or a steady climb, and your best guess at the cause.
get_check + get_check_history the agent has the SQL, the recent statuses, and the
failing values — enough to triage before a human even opens the dashboard.
If you belong to more than one organization
Every MCP tool takes an optionalorganization_id. Omit it and the tool uses your
default org; pass it and the tool acts in that org — so a single agent works across
all your organizations without re-linking or restarting.
The alert webhook already carries the org: pass its org_id straight through as
organization_id:
list_organizations to see the ones you belong
to and their ids. You can only ever act in organizations you’re a member of — the
backend re-checks your membership and role on every call, whatever organization_id
you pass.
The CLI also supports a per-command
alertee --org <id> … override, and alertee link
still sets a persistent default. MCP can’t persist a link (each call is stateless), so
it names the org per call via organization_id instead.