# agent402.tools Onchain SQL Schema

> agent402.tools Onchain SQL Schema is a paid API for AI agents from agent402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Returns the full table and column schema for the onchain-sql query tool, listing every queryable blockchain table with its columns and types

## Facts

- Endpoint: GET https://agent402.tools/api/onchain-sql-schema
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-onchain-sql-schema-abd0b7de
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TfbScl69dibM7eaB8V9ef

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 agent402-tools-onchain-sql-schema-abd0b7de
```

Example prompt: Before I write an onchain SQL query, can you fetch the full schema for the onchain-sql tool so I know what tables like base.events, base.transactions, and solana.instructions look like — including all their columns and types?

## When to prefer this

Use this endpoint as a prerequisite before writing any onchain SQL query — it tells you exactly what tables and columns exist so you can write valid SQL. Prefer this over guessing schema or relying on documentation that may be outdated.

## Known failure modes

- Network or service unavailability returns a non-200 HTTP status
- Payment failure (402) if the $0.002 USDC x402 payment is not processed
- Schema may be stale if blockchain indexer adds new tables not yet reflected

## How this service works

The table + column schema for the onchain-sql tool - every queryable table (base.events, base.transactions, base.blocks, base.decoded_user_operations, base.transaction_attributions, solana.instructions, …) with its columns and types. Fetch once, then write SQL with confidence.

## Output

A structured schema document listing every queryable blockchain table (e.g. base.events, base.transactions, base.blocks, base.decoded_user_operations, base.transaction_attributions, solana.instructions) with each column name and its data type, enabling accurate SQL query construction.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "required": {
   "type": "string"
  },
  "properties": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "schema": {
   "base.events": [
    {
     "name": "block_number",
     "type": "UInt64"
    }
   ]
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-onchain-sql-schema-abd0b7de/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
