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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure and does this well. It explains that the tool returns an execution_id for checking status/retrieving results, mentions performance tiers with defaults, and references external syntax documentation. It doesn't cover rate limits, authentication requirements, or error handling, but provides substantial operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and efficiently organized with clear sections (purpose, args, returns, examples). Every sentence adds value - no repetition or filler. The front-loaded purpose statement immediately communicates the tool's core function, making it easy for an agent to understand.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (raw SQL execution), no annotations, and the presence of an output schema, the description provides excellent contextual completeness. It covers purpose, parameters with semantics, return value explanation, and practical examples. The output schema handles return value details, so the description appropriately focuses on operational context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description provides excellent parameter semantics. It clearly explains both parameters: 'sql' includes syntax reference and examples, and 'performance' explains the two tiers and default value. This fully compensates for the schema's lack of descriptions and adds meaningful context beyond basic type definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verb ('Execute') and resource ('raw SQL query against Dune's data engine'), and distinguishes it from siblings by calling it 'the primary tool for running custom SQL queries on blockchain data.' This explicitly differentiates it from other query-related tools like execute_query or get_query_results.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool ('primary tool for running custom SQL queries') and includes an example section showing typical use cases. However, it doesn't explicitly state when NOT to use it or mention specific alternatives among the many sibling tools, which prevents a perfect score.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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