Skip to main content
Glama
SAK1337

Dune Analytics MCP Server

by SAK1337
tasks.md855 B
# Tasks: Add Run SQL Tool for Ad-Hoc Queries ## 1. Tool Implementation - [x] 1.1 Implement run_sql tool with @mcp.tool decorator - [x] 1.2 Add sql (required), performance, limit parameters - [x] 1.3 Use POST /v1/sql/execute endpoint via SDK - [x] 1.4 Apply default limit of 50 rows ## 2. Input Validation - [x] 2.1 Validate SQL string is not empty - [x] 2.2 Return clear error message for empty SQL ## 3. Error Handling - [x] 3.1 Map SQL syntax errors to helpful messages - [x] 3.2 Handle timeout for complex queries - [x] 3.3 Apply standard error mapping (401, 402, 429) ## 4. Async Support - [x] 4.1 Wrap SDK call with asyncio.to_thread - [x] 4.2 Add Context logging for progress ## 5. Validation - [x] 5.1 Test with valid SELECT query - [x] 5.2 Test with syntax error - [x] 5.3 Test with empty SQL string - [x] 5.4 Verify default limit is applied

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/SAK1337/dune-mcp'

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