# How Can an Uptime Monitor Tell Customers Why Their Vercel Site Went Down? One Agent per Customer, Signed Into Their Own Vercel

An uptime monitoring company makes one agent per customer, signed into the customer's Vercel, that explains each downtime alert from deploys and runtime errors.

[Run this on Rush](https://cloud.getrush.ai/run/explain-each-downtime-alert/vercel/). Opens the console with this prompt ready to send. Connect Vercel there first.

## What the agent does

This is for a company that sells uptime monitoring: it probes its customers' websites every minute from several regions and pages them when a site stops answering. Many of those sites run on Vercel, and the first question after every page is the same: did we just deploy something, or is the site throwing errors? The monitor knows that the site failed, with which status code and from where, but not why. The company saves one agent as a template that names Vercel, and makes one agent from it per customer, signed into that customer's own Vercel account, so each alert can arrive with the likely cause attached.

The company connects its own Vercel once with `POST /me/connections {"type": "mcp", "name": "vercel", "url": "https://mcp.vercel.com", "auth": {"mode": "oauth"}}` and saves the template with `POST /o/{org}/agents`, naming `vercel` in `connections` and putting the read-only rules in `instructions`. When a customer turns on the Vercel integration in the monitor's settings, the backend calls `POST /o/{org}/agents {"template": "<template id>", "name": "incidents-<customer id>"}`, then `POST /o/{org}/agents/{agent}/connections {"type": "mcp", "name": "vercel"}`, and opens the `authorize_url` in a popup. Vercel's docs say the person signing in grants the connection access to the teams it may work with, so the customer chooses which team the agent can see. They also pick which Vercel project each monitored URL belongs to, and the monitor stores the project and team ids beside the check.

When a check fails, the agent calls `list_deployments` for that project with `target` set to production and `since` an hour before the first failure, then `get_deployment` with `withGitRepoInfo` on the newest one, which Vercel's docs say returns the commit SHA and branch. It calls `get_runtime_errors` for the window from thirty minutes before the first failure to now, which returns grouped error clusters with their names, counts, affected routes, sample messages and first and last seen times. For the largest cluster it calls `get_runtime_logs` with `level` set to error and fatal, `environment` set to production, and `group_by` set to `deploymentId`, so it can tell whether the errors began with the new deployment or were already there.

From those reads it writes a short verdict: a production deployment went live within minutes before the first failed probe and the errors began with it; or there was no deployment and the errors are on one route; or Vercel shows nothing wrong, which points away from the application (DNS, a domain, or the probe's own region). The template's instructions forbid every write: no redeploy, no rollback, no change to environment variables or domains. Vercel's docs say a connection has the same access as the Vercel user who signed in and advise keeping a person in the loop for changes, so the customer decides what to do with the verdict.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "<agent id>",
  "input": "A downtime alert fired. Check: https://shop.example.com/ (check id chk_4821). First failed probe 2026-11-20T14:02:00Z, still failing at 2026-11-20T14:09:00Z, HTTP 500 from all 4 regions. Vercel team team_8hQ2, project prj_W3k9. 1) Call list_deployments for the project with target production and since 2026-11-20T13:02:00Z; call get_deployment with withGitRepoInfo true on the newest READY one. 2) Call get_runtime_errors with since 2026-11-20T13:32:00Z. 3) For the cluster with the most occurrences, call get_runtime_logs with level [error, fatal], environment production, the same since, and group_by deploymentId; then once without group_by, limit 20, to quote three sample lines. Return only JSON: {verdict: 'deploy' | 'runtime_errors_no_deploy' | 'nothing_in_vercel', deployment: {id, url, created_at, commit_sha, branch, creator} or null, error_clusters: [{name, count, routes, first_seen, last_seen}], errors_by_deployment: [{deployment_id, count}], sample_lines: [string], summary: one paragraph for the customer}. Read only: never redeploy, roll back, promote, or change any setting, variable or domain."
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

The answer is JSON in the session's `result` and in the `run.completed` webhook the monitor's API key sends. The monitor attaches it to the open incident: the verdict, the deployment that went live just before the failure with its commit and branch, the error clusters with their routes, and a paragraph the customer reads on their phone. A verdict of `deploy` with errors that start at that deployment's id is the case that saves the most time, because the customer can roll back from Vercel straight away.

What the customer checks before acting: that the deployment named is really the one their team shipped, from the commit and branch; that the error cluster's routes are the pages the probe hits; and, for `nothing_in_vercel`, the monitor's own per-region results. Correlation in time is not proof of cause, and the summary says "likely" for that reason. The runtime logs come from Vercel Functions, so a site whose failures happen in its static pages or at its domain shows little there.

## Run it on every monitored site that goes down

The monitor's alerting service sends one `POST /o/{org}/sessions` with that customer's agent id as `agent` and the check, the times and the project ids in `input`, as soon as an incident opens. It sends a `request_id` that is a UUID v5 of the incident id, so if the alerting job retries, it gets back the run it already started instead of a second one.

A widespread problem, such as a Vercel region outage, can open hundreds of incidents in the same minute. Runs past the API key's concurrent limit wait `queued` and start as earlier ones finish, so the first customers paged get their explanation first, and nothing is lost.

## Why run it on Rush?

Each customer signs in to Vercel on Vercel's own page and chooses the teams the agent may see; that sign-in belongs to the customer's agent alone. One customer's run cannot read another customer's projects, and the monitoring company holds agent ids, not Vercel tokens. The session's `accounts` names the connection each run used, and `GET /o/{org}/sessions?account=<connection id>` lists every run that touched it, which is the answer a customer's security review asks for.

Each run has its own computer and a record of every tool call and its parameters, so when a customer says the explanation was wrong, the company opens the session and sees exactly which deployments and log windows the agent read. `GET /o/{org}/sessions?agent=<agent id>` lists one customer's runs with their `total_cost_usd`, so the feature can be priced per incident or folded into a plan.

## Frequently asked questions

### Which Vercel plan does the customer need?

Vercel's docs say Vercel MCP is available on all plans. What the agent can see still depends on the plan's log retention: `get_runtime_errors` looks back at most seven days, and `get_runtime_logs` defaults to the 50 minutes before its end time, within Hobby's retention window, so an incident is best explained while it is fresh.

### Could the agent roll back the bad deployment itself?

It could be given that job, since the connection has the signed-in user's own access. This template forbids it on purpose: a rollback during an incident is a decision the customer's own team makes. A monitor that wants one-click rollback can show a button that starts a second run, with a prompt that names the deployment and the person who approved it.

### What if the customer's connection shows fewer tools?

Vercel's tools reference says some connections expose a smaller workflow tool list, where `list_deployments` takes `projectId`, `teamId`, `since` and `until` only. The prompt asks for filters the agent can apply itself after reading the list, so it works with either schema.

### What happens when a customer disconnects Vercel?

The agent's `missing_connections` lists Vercel again, and a new run of it is refused `422 CONNECTION_NOT_READY` before a computer starts, so nothing is read. The monitor reads that list with `GET /o/{org}/agents/{agent}`, sends alerts without an explanation meanwhile, and asks the customer to reconnect.

## More Vercel jobs

- [Did Any Client's Contact Form Fail Yesterday? A Web Design Agency's Morning Check of Its Vercel Runtime Logs](https://getrush.ai/run/find-client-contact-forms-that-failed-yesterday/vercel/)
- [Find Slow Vercel Builds](https://getrush.ai/run/build-time-report/vercel/)
- [Which Client Domains Expire Soon Without Auto-Renew? A Web Design Agency's Monthly Check of Every Domain on Vercel](https://getrush.ai/run/check-client-domains-before-they-expire/vercel/)

## More jobs like this: Run an agent per customer task

- [Explain Each User's Monthly Profit and Loss From Their Own QuickBooks](https://getrush.ai/run/explain-monthly-profit-and-loss/quickbooks/)
- [Read Supplier Invoice PDFs From Each Customer's OneDrive Into Draft Bills](https://getrush.ai/run/extract-supplier-invoices/onedrive/)
- [Which of Our Customers' Accounts Stopped Using the Product This Week? A Customer-Success App's Weekly Check of Each Customer's PostHog](https://getrush.ai/run/find-accounts-whose-usage-dropped/posthog/)

## Keep reading

- [Connect Vercel to Rush once, then name it on any run](https://getrush.ai/integrations/vercel/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
