# SQL Formatter and Analyzer

> SQL Formatter and Analyzer is a paid API for AI agents from intel.rallylive.ca, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Formats SQL statements with standardized casing and indentation, and extracts metadata such as statement type, referenced tables, and write operation detection.

## Facts

- Endpoint: GET https://intel.rallylive.ca/dev/sql-format
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sql-formatter-and-analyzer-eaf390fd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_V3M02gEu-qWNt8g23Lcvx

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 sql-formatter-and-analyzer-eaf390fd
```

Example prompt: Can you format this SQL for me — uppercase the keywords, break it into proper clauses, and tell me which tables it touches and whether it's a write operation? SELECT id, name FROM users u JOIN orders o ON u.id = o.user_id WHERE o.status = 'pending'

## When to prefer this

Choose this endpoint when you need both SQL formatting and lightweight static analysis (table extraction, write-op detection) in a single call. It is ideal for developer tools, SQL review pipelines, audit workflows, and code review agents that need to make raw SQL human-readable and extract structural metadata without executing the query. Prefer it over generic code formatters that don't understand SQL clause structure.

## Known failure modes

- Missing or empty SQL input returns an error
- Highly non-standard or proprietary SQL dialects may not parse correctly
- Very long or deeply nested queries may produce unexpected formatting
- Query params not passed correctly result in no output
- Malformed SQL may still be formatted but metadata may be incomplete or incorrect

## How this service works

SQL formatter: upper-cases keywords, breaks the statement into SELECT/FROM/JOIN/WHERE/GROUP BY/ORDER BY clauses, one column per line, indents AND/OR, and reports the statement type, tables referenced and whether it looks like a write (INSERT/UPDATE/DELETE/DROP). Works on most ANSI SQL dialects. $0.01 per statement.

## Output

Returns the original SQL reformatted with uppercased keywords, clause-by-clause line breaks (SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY), one column per line, and indented AND/OR conditions. Also returns metadata: the detected statement type (e.g. SELECT, INSERT), a list of referenced table names, and a boolean flag indicating whether the statement appears to be a write operation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sql-formatter-and-analyzer-eaf390fd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from intel.rallylive.ca](https://www.zero.xyz/host/intel.rallylive.ca/llms.txt)
