# sqlscan-check

> sqlscan-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).

Pre-flight safety and performance analysis of a SQL query returning a pass/caution/block verdict with per-finding severity, reason, and fix suggestion.

## Facts

- Endpoint: POST https://payai.agentstools.dev/sql/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/sqlscan-check-b6c01d6f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_btQJnFVxVVBEounGa2JrG

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 sqlscan-check-b6c01d6f -d '<json body>'
```

Example prompt: Before I run this query on our Postgres database, can you do a safety and performance check on it? The query is: DELETE FROM orders WHERE status = 'pending' — I want to know if it's safe or if there are any red flags.

## When to prefer this

Use this endpoint when an AI agent or automated pipeline is about to execute a SQL query — especially user-supplied, AI-generated, or dynamically constructed queries — and you need a quick safety and performance gate before touching the database. Prefer this over generic linting tools when you need dialect-aware (Postgres/MySQL/SQLite/BigQuery/Snowflake) analysis with actionable per-finding fixes. Ideal for agent workflows that construct SQL from natural language and need a guardrail layer before execution.

## Known failure modes

- Unsupported dialect submitted — only postgres, mysql, sqlite, bigquery, snowflake are accepted
- Malformed or unparseable SQL returns an error or inconclusive verdict
- False negatives: complex nested queries may not catch all issues
- Missing indexed_columns hint may produce less accurate performance findings
- Empty or blank sql field returns a validation error

## How this service works

Safety and performance preflight for a database query BEFORE you run it. Send the query for Postgres, MySQL or SQLite and get a pass, caution or block verdict with per-finding operation, severity, plain-language reason and a fix. Query-safety indicators, not a guarantee.

## Output

A structured verdict (pass, caution, or block) for the submitted query, along with an array of findings each containing the SQL operation involved, a severity level, a plain-language explanation of the issue, and a recommended fix. Acts as a safety indicator rather than a guarantee of execution safety.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "sql": {
   "type": "string",
   "description": "The query text to check"
  },
  "dialect": {
   "enum": [
    "postgres",
    "mysql",
    "sqlite",
    "bigquery",
    "snowflake"
   ],
   "type": "string",
   "description": "Database dialect (default postgres)"
  },
  "options": {
   "type": "object",
   "description": "Optional hints, e.g. indexed_columns: list of column names to refine performance findings"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sqlscan-check-b6c01d6f/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)
