Skip to content
Eden Engine

On-Chain SQL Query Check and Scan Estimate (ClickHouse, Not Executed)

omnial/onchain-sql-query-cost-estimate

Given a read-only ClickHouse SQL query over curated on-chain datasets such as Ethereum DEX trades, checks and estimates it without running it: whether it is accepted, the SQL as it would run, each table read with its columns and types and its source tables' keys, rows and bytes, the estimated parts, rows, marks and bytes to read, the scan budget, and guardrail warnings with a recommended action. No query rows are returned.

activeper callv1

Price

Up to $0.0328 per call; you pay what the call used

You pay the price shown. If a call turns out to cost more than its quote, you pay the actual price, capped at twice the quote. No monthly minimum. Top-ups start at $5.00.

Data source

Public blockchains

Blockchain data from public chains.

Use it

Your AI assistant does the work: it finds this tool, shows you the price first, runs it, and you are charged when the run finishes. There is nothing to set up for this tool in particular.

Connect once and your AI can find and run this tool, and any other it needs.

For developers: the calls your assistant makes
agent
// 1. search: find the tool
omnial_search({ query: "what you need" })

// 2. inspect: price and input schema
omnial_inspect({ tool: "omnial/onchain-sql-query-cost-estimate" })

// 3. learn: read the usage guide at runtime
omnial_learn({ tool: "omnial/onchain-sql-query-cost-estimate" })

// 4. run: price the exact call first, then run it
omnial_execute({ tool: "omnial/onchain-sql-query-cost-estimate", input: { /* see input_schema */ }, dry_run: true })
omnial_execute({ tool: "omnial/onchain-sql-query-cost-estimate", input: { /* ... */ } })

// 5. settle: the call is charged when it finishes, nothing to do

Not connected yet? Point your MCP client at https://mcp.eden-engine.com/mcp, then copy a config for your client.

Pricing

Every charge this tool can incur.

ChargePrice
Per call
$0.0328
Updated
Oct 27, 2026

Input and output schemas

Input schema
input_schema.json
{
  "type": "object",
  "required": [
    "sql"
  ],
  "properties": {
    "sql": {
      "type": "string",
      "minLength": 1,
      "description": "A read-only ClickHouse SELECT or WITH query. Qualify every table as agent.<table>; always filter on block_date or block_number (the partition key); compare address columns directly against lowercase literals; do not filter on symbol columns; on transfer tables use separate UNION ALL branches instead of OR across from and to; use single quotes for strings."
    },
    "max_rows": {
      "enum": [
        100,
        1000
      ],
      "type": "integer",
      "default": 1000,
      "description": "The row limit written into the checked SQL: 100, or 1000 (the default)."
    }
  },
  "additionalProperties": false
}
Output schema
output_schema.json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "sql": {
          "type": "string",
          "description": "The query as sent."
        },
        "budget": {
          "type": "object",
          "properties": {
            "max_rows_to_read": {
              "type": "number"
            },
            "max_bytes_to_read": {
              "type": "number"
            },
            "max_execution_time_seconds": {
              "type": "number"
            }
          },
          "description": "The scan caps a run of the query would be held to."
        },
        "tables": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "table": {
                "type": "string"
              },
              "engine": {
                "type": "string"
              },
              "columns": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "A column name."
                    },
                    "type": {
                      "type": "string",
                      "description": "The column's ClickHouse type."
                    }
                  }
                }
              },
              "database": {
                "type": "string"
              },
              "physical_sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "table": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string"
                    },
                    "database": {
                      "type": "string"
                    },
                    "total_rows": {
                      "type": "number"
                    },
                    "primary_key": {
                      "type": "string"
                    },
                    "sorting_key": {
                      "type": "string"
                    },
                    "total_bytes": {
                      "type": "number"
                    },
                    "partition_key": {
                      "type": "string"
                    }
                  }
                },
                "description": "The stored tables behind it."
              }
            }
          },
          "description": "Each table the query reads."
        },
        "accepted": {
          "type": "boolean",
          "description": "Whether the query passed the checks."
        },
        "estimate": {
          "type": "object",
          "properties": {
            "rows": {
              "type": "number"
            },
            "bytes": {
              "type": "number"
            },
            "marks": {
              "type": "number"
            },
            "parts": {
              "type": "number"
            },
            "by_table": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "rows": {
                    "type": "number"
                  },
                  "bytes": {
                    "type": "number"
                  },
                  "marks": {
                    "type": "number"
                  },
                  "parts": {
                    "type": "number"
                  },
                  "table": {
                    "type": "string"
                  },
                  "database": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "description": "The estimated read, overall and per source table."
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "severity": {
                "type": "string"
              },
              "recommended_action": {
                "type": "string"
              }
            }
          },
          "description": "Guardrail warnings."
        },
        "executed_sql": {
          "type": "string",
          "description": "The query as it would run, with the row limit and read caps added."
        }
      }
    }
  },
  "description": "The query check and scan estimate, as returned after shaping."
}