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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

With no annotations provided, the description carries full burden. It mentions the tool 'creates and saves' a query, implying persistence and mutation, but doesn't disclose authentication requirements, rate limits, whether the operation is idempotent, or what happens on duplicate names. The example helps but doesn't cover behavioral traits comprehensively.

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

Conciseness4/5

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

Well-structured with clear sections (Args, Returns, Example) and front-loaded purpose statement. The parameter explanations are detailed but necessary given 0% schema coverage. Slightly verbose but each sentence adds value for understanding.

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

Completeness4/5

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

Given 6 parameters with 0% schema coverage and no annotations, the description does an excellent job explaining parameters and providing an example. The output schema exists ('Returns: Created query details including query_id'), so return values don't need explanation. Minor gap in behavioral context for a mutation tool.

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?

Schema description coverage is 0%, so the description must compensate fully. It provides detailed explanations for all 6 parameters, including syntax guidance for query_sql ('Use {{param_name}} for parameters'), default values, optional status, and nested structure for parameters field. This adds substantial meaning beyond the bare schema.

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 specific action ('Create and save a new query') and resource ('on Dune'), distinguishing it from siblings like update_query, execute_query, or get_query. It explicitly mentions saving, which differentiates it from temporary execution tools.

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

Usage Guidelines3/5

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

The description implies usage for creating persistent queries on Dune, but doesn't explicitly state when to use this versus alternatives like execute_sql (for one-time execution) or update_query (for modifications). No explicit exclusions or prerequisites are mentioned.

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