Skip to main content
Glama

create_query

Create and save SQL queries on Dune Analytics to analyze blockchain data across multiple chains, with support for parameters and organization.

Instructions

Create and save a new query on Dune.

Args: name: Name for the query. query_sql: The SQL query text. Use {{param_name}} for parameters. description: Optional description of what the query does. is_private: Whether the query should be private (default False). parameters: Optional list of parameter definitions, each with: - key: Parameter name - value: Default value - type: "text", "number", or "enum" - enumOptions: List of allowed values (for enum type) tags: Optional list of tags for organization.

Returns: Created query details including query_id.

Example: create_query( name="Top DEX Volume", query_sql="SELECT project, SUM(amount_usd) as volume FROM dex.trades WHERE block_time > now() - interval '{{days}}' day GROUP BY 1 ORDER BY 2 DESC LIMIT 10", parameters=[{"key": "days", "value": "7", "type": "number"}] )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
query_sqlYes
descriptionNo
is_privateNo
parametersNo
tagsNo

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