# AgentsTools Migration Safety Check

> AgentsTools Migration Safety Check is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Analyzes database migration SQL for Postgres or MySQL and returns a pass/caution/block verdict with per-finding severity, plain-language reasons, and zero-downtime alternatives.

## Facts

- Endpoint: POST https://api.agentstools.dev/migrate/check
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentstools-migration-safety-check-a49fe93f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-WeKth-KfFeFbjQ-0smU-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentstools-migration-safety-check-a49fe93f -d '<json body>'
```

Example prompt: Before I apply this migration, can you do a safety preflight check on this Postgres SQL — `ALTER TABLE orders ADD COLUMN status VARCHAR(255) NOT NULL DEFAULT 'pending';` — and tell me if it'll cause downtime, what the risk level is, and if there's a safer zero-downtime way to do it?

## When to prefer this

Choose this endpoint when you need a fast, automated pre-flight safety check on a database migration SQL before applying it to production — especially for Postgres or MySQL. It is ideal for CI/CD pipeline gates, agent-driven deployment workflows, or anytime a human wants a quick risk verdict with actionable alternatives without manually reviewing DDL. Prefer this over manual review when speed and consistency matter, and over generic LLM SQL review when you need structured, machine-readable per-finding output with severity levels.

## Known failure modes

- Invalid or unparseable SQL returns an error or low-confidence verdict
- Unsupported dialect or format results in a rejection or fallback
- Very long or complex migration scripts may exceed input limits
- Dialect mismatch (e.g. MySQL syntax sent with postgres dialect) may produce incorrect analysis
- Network or payment failure returns a non-200 response

## How this service works

Safety preflight for a database schema migration BEFORE you apply it. Send the migration SQL for Postgres or MySQL and get a pass, caution or block verdict with per-finding operation, severity, plain-language reason and a zero-downtime alternative. Migration-safety indicators, not a guarantee.

## Output

A structured safety report containing an overall verdict (pass, caution, or block), plus a list of per-finding details — each with the SQL operation involved, a severity level, a plain-language explanation of the risk, and a suggested zero-downtime alternative approach where applicable. This is an advisory signal, not a guaranteed outcome.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "sql": {
   "type": "string",
   "description": "The migration SQL / DDL text to check"
  },
  "format": {
   "enum": [
    "sql",
    "alembic",
    "auto"
   ],
   "type": "string",
   "description": "Input format: raw SQL, an Alembic change file, or auto"
  },
  "dialect": {
   "enum": [
    "postgres",
    "mysql"
   ],
   "type": "string",
   "description": "Database dialect (default postgres)"
  },
  "options": {
   "type": "object",
   "description": "Optional hints: rolling_deploy, pg_version, in_transaction"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentstools-migration-safety-check-a49fe93f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
