query_archive_sql
Execute read-only SQL queries against Mina's archive database to fetch blockchain data such as blocks, commands, and accounts. Only SELECT, WITH, and EXPLAIN statements are permitted.
Instructions
[infra][tutorial+snapshot] Execute a read-only SQL query against the archive database. Only SELECT/WITH/EXPLAIN statements are allowed. Query timeout is 10 seconds. Not available in live mode (no archive DB). Common tables: blocks, user_commands, internal_commands, public_keys, accounts_accessed. Call get_archive_schema first if you don't know the table layout.
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": {
"sql": "<sql>"
},
"name": "query_archive_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Read-only SQL (SELECT / WITH / EXPLAIN only). Example: SELECT state_hash, height FROM blocks WHERE chain_status = 'canonical' ORDER BY height DESC LIMIT 10 | |
| params | No | Parameterized values: $1, $2, ... in the SQL |