Skip to main content
Glama

execute_sql

Run custom SQL queries on blockchain data from Dune Analytics to analyze transactions, trades, and wallet activity across multiple chains.

Instructions

Execute a raw SQL query against Dune's data engine.

This is the primary tool for running custom SQL queries on blockchain data. Returns an execution_id that can be used to check status and retrieve results.

Args: sql: The SQL query to execute. Use DuneSQL (Trino) syntax. Read dune://guide/sql-syntax for syntax reference. performance: Performance tier - "medium" (default) or "large" for complex queries.

Returns: Execution details including execution_id and initial state.

Example SQL queries: - SELECT * FROM dex.trades WHERE block_time > now() - interval '1' day LIMIT 10 - SELECT blockchain, SUM(amount_usd) as volume FROM dex.trades GROUP BY 1

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
performanceNomedium

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mwamedacen/dune-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server