# Batch Database Migration Safety Preflight

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

Runs safety preflight checks on multiple database migration SQL files at once, returning per-file pass/caution/block verdicts plus a rollup summary.

## Facts

- Endpoint: POST https://api.agentstools.dev/migrate/batch
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/batch-database-migration-safety-preflight-312f2018
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JspWhwQUS4aJ74_A4G_hp

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 batch-database-migration-safety-preflight-312f2018 -d '<json body>'
```

Example prompt: Run a batch migration safety preflight on these three migrations: 'add_user_index' with SQL 'CREATE INDEX idx_users ON users(email);', 'drop_old_column' with SQL 'ALTER TABLE orders DROP COLUMN legacy_id;', and 'rename_table' with SQL 'ALTER TABLE sessions RENAME TO user_sessions;' — give me a verdict for each and tell me the worst overall.

## When to prefer this

Use this endpoint when you need to evaluate multiple database migrations in a single call and want a consolidated rollup verdict alongside per-file results. Prefer this over single-migration checks when running CI/CD gates, reviewing PRs with multiple migrations, or replaying migration histories. It is purpose-built for batch safety assessment of SQL migrations specifically, not general SQL linting or execution.

## Known failure modes

- Empty or missing migrations list returns a validation error
- Malformed SQL in a migration entry may result in a parse error or automatic block verdict
- Exceeding maximum batch size returns an error
- Non-SQL content in migration fields may produce unreliable verdicts
- Network timeout if batch is very large

## How this service works

Batch safety preflight for many database migrations at once: a list of objects each with a name and migration SQL. Returns a per-file pass, caution or block verdict plus a rollup with the worst verdict and counts. Migration-safety indicators, not a guarantee.

## Output

Returns an array of per-file results each containing the migration name and a verdict of pass, caution, or block, along with a rollup object showing the worst overall verdict and counts of each verdict type across all submitted migrations. Includes migration-safety indicators that informed each decision.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "format": {
   "enum": [
    "sql",
    "alembic",
    "auto"
   ],
   "type": "string",
   "description": "Default input format for entries that do not set one"
  },
  "dialect": {
   "enum": [
    "postgres",
    "mysql"
   ],
   "type": "string",
   "description": "Default dialect for entries that do not set one"
  },
  "migrations": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "List of objects, each with name and migration SQL"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/batch-database-migration-safety-preflight-312f2018/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)
