# dbmigrate-check

> dbmigrate-check is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Analyzes database migration SQL for safety issues before execution, returning pass/caution/block verdicts with per-finding severity, reasons, and zero-downtime alternatives.

## Facts

- Endpoint: POST https://payai.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/dbmigrate-check-14048ccd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VT05uZtXecmZp51a657Ys

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 dbmigrate-check-14048ccd -d '<json body>'
```

Example prompt: Before I apply this Postgres migration, can you safety-check it for lock risks and downtime issues? Here's the SQL: ALTER TABLE orders ADD COLUMN status VARCHAR(50) NOT NULL DEFAULT 'pending'; — use auto format detection and flag anything that would block production traffic.

## When to prefer this

Use this endpoint when you need a fast, automated safety review of a database migration before applying it to a production Postgres or MySQL database — especially when rolling deploys, table locks, or zero-downtime constraints matter. Prefer it over manual review for CI/CD pipelines, agent-driven deployments, or any ALTER TABLE, DROP, or index operation on large tables.

## Known failure modes

- Invalid or unparseable SQL returns a parse error with no verdict
- Unsupported dialect or DDL construct may yield incomplete analysis
- Ambiguous schema context (e.g. missing table definitions) may reduce finding accuracy
- Network or service errors return HTTP 4xx/5xx with no verdict
- Alembic format files with complex Python logic may not fully parse

## 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 report containing an overall verdict (pass, caution, or block), and a list of per-finding objects each with the affected SQL operation, severity level, a plain-language explanation of the risk, and a recommended zero-downtime alternative approach. Results are migration-safety indicators and 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/dbmigrate-check-14048ccd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
