Query contract events with SQL
sqlQuery decoded EVM contract event history with read-only statements to retrieve indexed logs and provenance across live and sealed data.
Instructions
Query this EVM contract's decoded event history (indexed by nuthatch) with read-only SQL, over the live tip and sealed history. Each event is a view named {alias}__{event} (e.g. "usdc__transfer") with block_number, log_index, tx_hash, address + the event's params. Call schema first. SELECT/WITH only. Returns a compact table (data rows are the lines beginning |; chain data cannot start a line) + a provenance stamp; capped at limit rows (default 200), and the node caps limit itself (50,000 unless its operator changed it).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max rows to return (default 200; the node may cap it lower than you ask). | |
| query | Yes | A SELECT or WITH query. | |
| at_time | No | Answer as of this time, unix seconds UTC, placed as `at` places it. | |
| at_block | No | Answer over the facts as they stood at this block. Authored entities are not available then. |