Skip to content

Commit ea255e4

Browse files
committed
rich tool descriptions
1 parent a8abb87 commit ea255e4

15 files changed

Lines changed: 101 additions & 58 deletions

File tree

cli/root.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ var apiKeyFlag string
2424

2525
var rootCmd = &cobra.Command{
2626
Use: "dune",
27-
Short: "Dune CLI — interact with the Dune Analytics API",
28-
Long: "A command-line interface for interacting with the Dune Analytics API.\n" +
29-
"Manage queries, execute them, and retrieve results.",
27+
Short: "Dune CLI — query, explore, and manage blockchain data on Dune Analytics",
28+
Long: "A command-line interface for the Dune Analytics platform.\n\n" +
29+
"Discover datasets across the Dune catalog, execute SQL queries (DuneSQL dialect),\n" +
30+
"retrieve execution results, and manage your saved queries — all from the terminal.\n\n" +
31+
"Authenticate with an API key via --api-key, the DUNE_API_KEY environment variable,\n" +
32+
"or by running `dune auth`.",
3033
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
3134
if cmd.Annotations["skipAuth"] == "true" {
3235
return nil

cmd/dataset/dataset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "github.com/spf13/cobra"
66
func NewDatasetCmd() *cobra.Command {
77
cmd := &cobra.Command{
88
Use: "dataset",
9-
Short: "Manage Dune datasets",
9+
Short: "Discover and explore datasets across the Dune catalog",
1010
}
1111
cmd.AddCommand(newSearchCmd())
1212
return cmd

cmd/dataset/search.go

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,26 @@ import (
1313
func newSearchCmd() *cobra.Command {
1414
cmd := &cobra.Command{
1515
Use: "search",
16-
Short: "Search for datasets across the Dune catalog",
16+
Short: "Search for tables and datasets across the Dune catalog",
17+
Long: "Natural-language table discovery across the Dune catalog. Use this command\n" +
18+
"to find concrete table names for use in SQL queries.\n\n" +
19+
"Filter by category (canonical for chain primitives, decoded for ABI-level\n" +
20+
"events/calls, spell for curated datasets, community for user-contributed),\n" +
21+
"by blockchain, schema, dataset type, or ownership scope.",
1722
RunE: runSearch,
1823
}
1924

20-
cmd.Flags().String("query", "", "search query text")
21-
cmd.Flags().StringArray("categories", nil, "filter by category (canonical, decoded, spell, community)")
22-
cmd.Flags().StringArray("blockchains", nil, "filter by blockchain")
23-
cmd.Flags().StringArray("dataset-types", nil, "filter by dataset type")
24-
cmd.Flags().StringArray("schemas", nil, "filter by schema")
25-
cmd.Flags().String("owner-scope", "", "ownership filter (all, me, team)")
26-
cmd.Flags().Bool("include-private", false, "include private datasets")
27-
cmd.Flags().Bool("include-schema", false, "include column schema in results")
28-
cmd.Flags().Bool("include-metadata", false, "include metadata in results")
29-
cmd.Flags().Int32("limit", 20, "maximum number of results")
30-
cmd.Flags().Int32("offset", 0, "pagination offset")
25+
cmd.Flags().String("query", "", "natural-language search intent or entity hints (e.g. 'uniswap v3 swaps'); use '*' to browse without keyword bias")
26+
cmd.Flags().StringArray("categories", nil, "filter by table family: canonical (chain primitives), decoded (ABI-level events/calls), spell (curated datasets), community (user-contributed)")
27+
cmd.Flags().StringArray("blockchains", nil, "chain scope to reduce ambiguity and improve ranking (e.g. ethereum, solana)")
28+
cmd.Flags().StringArray("dataset-types", nil, "fine-grained dataset type filter: dune_table, decoded_table, spell, uploaded_table, transformation_table, transformation_view")
29+
cmd.Flags().StringArray("schemas", nil, "schema/namespace constraint for high precision (e.g. dex, uniswap_v3_ethereum)")
30+
cmd.Flags().String("owner-scope", "", "ownership filter: all, me, or team; does NOT automatically include private datasets")
31+
cmd.Flags().Bool("include-private", false, "widen results to include private datasets visible to the authenticated user/team alongside public ones")
32+
cmd.Flags().Bool("include-schema", false, "include column-level schema (name, type, nullable) for every result; useful when preparing SQL")
33+
cmd.Flags().Bool("include-metadata", false, "include category-specific metadata (page_rank_score, description, abi_type, contract_name, project_name, etc.)")
34+
cmd.Flags().Int32("limit", 20, "number of results per page; use 5-15 for quick checks, 20-50 for deeper exploration")
35+
cmd.Flags().Int32("offset", 0, "pagination offset; use previous response pagination info for next page")
3136
output.AddFormatFlag(cmd, "text")
3237

3338
return cmd

cmd/docs/docs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "github.com/spf13/cobra"
66
func NewDocsCmd() *cobra.Command {
77
cmd := &cobra.Command{
88
Use: "docs",
9-
Short: "Search and browse Dune documentation",
9+
Short: "Search the Dune documentation for guides, API references, and examples",
1010
Annotations: map[string]string{"skipAuth": "true"},
1111
}
1212
cmd.AddCommand(newSearchCmd())

cmd/docs/search.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ const defaultMCPEndpoint = "https://docs.dune.com/mcp"
1414
func newSearchCmd() *cobra.Command {
1515
cmd := &cobra.Command{
1616
Use: "search",
17-
Short: "Search the Dune documentation",
17+
Short: "Search the Dune documentation for guides, API references, and code examples",
18+
Long: "Search across all Dune documentation pages including guides, API references,\n" +
19+
"DuneSQL syntax, and code examples. Does not require authentication.",
1820
Annotations: map[string]string{"skipAuth": "true"},
1921
RunE: runSearch,
2022
}
2123

22-
cmd.Flags().String("query", "", "search query text (required)")
24+
cmd.Flags().String("query", "", "search query text, e.g. 'DuneSQL date functions' or 'API authentication' (required)")
2325
_ = cmd.MarkFlagRequired("query")
24-
cmd.Flags().Bool("api-reference-only", false, "prioritize API reference pages")
25-
cmd.Flags().Bool("code-only", false, "prioritize pages with code examples")
26+
cmd.Flags().Bool("api-reference-only", false, "prioritize API reference pages over conceptual guides")
27+
cmd.Flags().Bool("code-only", false, "prioritize pages with executable examples and code snippets")
2628
cmd.Flags().String("mcp-endpoint", defaultMCPEndpoint, "MCP server endpoint URL")
2729
_ = cmd.Flags().MarkHidden("mcp-endpoint")
2830
output.AddFormatFlag(cmd, "text")

cmd/execution/execution.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "github.com/spf13/cobra"
66
func NewExecutionCmd() *cobra.Command {
77
cmd := &cobra.Command{
88
Use: "execution",
9-
Short: "Manage query executions",
9+
Short: "Retrieve and inspect query execution results",
1010
}
1111
cmd.AddCommand(newResultsCmd())
1212
return cmd

cmd/execution/results.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,23 @@ var PollInterval = 2 * time.Second
1717
func newResultsCmd() *cobra.Command {
1818
cmd := &cobra.Command{
1919
Use: "results <execution-id>",
20-
Short: "Fetch results of a query execution",
20+
Short: "Get execution results for a query execution by execution ID",
21+
Long: "Retrieve the results of a query execution. By default, waits for the execution\n" +
22+
"to complete (up to the timeout) before returning results.\n\n" +
23+
"Behavior:\n" +
24+
" 1. Checks the current execution status\n" +
25+
" 2. If still running: polls until complete or timeout is reached\n" +
26+
" 3. If completed: returns the result data\n" +
27+
" 4. If failed/cancelled: returns the error details\n\n" +
28+
"Use --no-wait to return the current state immediately without polling.",
2129
Args: cobra.ExactArgs(1),
2230
RunE: runResults,
2331
}
2432

25-
cmd.Flags().Int("limit", 0, "maximum number of rows to return (0 = all)")
26-
cmd.Flags().Int("offset", 0, "number of rows to skip")
27-
cmd.Flags().Bool("no-wait", false, "fetch current state without waiting for completion")
28-
cmd.Flags().Int("timeout", 300, "maximum seconds to wait for completion")
33+
cmd.Flags().Int("limit", 0, "maximum number of result rows to return (0 = all)")
34+
cmd.Flags().Int("offset", 0, "number of rows to skip before returning results, used for pagination")
35+
cmd.Flags().Bool("no-wait", false, "return the current execution state immediately without waiting for completion")
36+
cmd.Flags().Int("timeout", 300, "maximum seconds to wait for the execution to complete before timing out")
2937
output.AddFormatFlag(cmd, "text")
3038

3139
return cmd

cmd/query/archive.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import (
1111
func newArchiveCmd() *cobra.Command {
1212
cmd := &cobra.Command{
1313
Use: "archive <query-id>",
14-
Short: "Archive a saved query",
14+
Short: "Archive a saved Dune query by ID",
15+
Long: "Mark a Dune query as archived. Archived queries are hidden from the library\n" +
16+
"but can still be retrieved by ID. You must own the query or have edit access\n" +
17+
"via team membership.",
1518
Args: cobra.ExactArgs(1),
1619
RunE: runArchive,
1720
}

cmd/query/create.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@ import (
1212
func newCreateCmd() *cobra.Command {
1313
cmd := &cobra.Command{
1414
Use: "create",
15-
Short: "Create a new saved query",
15+
Short: "Create a new Dune query and return the query ID",
16+
Long: "Create a new SQL query on Dune. Returns the query ID on success.\n\n" +
17+
"The query is written in DuneSQL dialect. If the query targets tables with\n" +
18+
"known partition columns, include a WHERE filter on those columns\n" +
19+
"(e.g. WHERE block_date >= CURRENT_DATE - INTERVAL '7' DAY) to enable\n" +
20+
"partition pruning and reduce query cost.",
1621
RunE: runCreate,
1722
}
1823

19-
cmd.Flags().String("name", "", "query name (required)")
20-
cmd.Flags().String("sql", "", "query SQL (required)")
21-
cmd.Flags().String("description", "", "query description")
22-
cmd.Flags().Bool("private", false, "make the query private")
23-
cmd.Flags().Bool("temp", false, "create a temporary (unsaved) query")
24+
cmd.Flags().String("name", "", "human-readable query title, max 600 characters (required)")
25+
cmd.Flags().String("sql", "", "the SQL query text in DuneSQL dialect, max 500,000 characters (required)")
26+
cmd.Flags().String("description", "", "short description of what the query does, max 1,000 characters")
27+
cmd.Flags().Bool("private", false, "make the query private; may be forced by team privacy settings")
28+
cmd.Flags().Bool("temp", false, "create a temporary query that won't appear in the dune.com library or be accessible when shared")
2429
_ = cmd.MarkFlagRequired("name")
2530
_ = cmd.MarkFlagRequired("sql")
2631
output.AddFormatFlag(cmd, "text")

cmd/query/get.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import (
1212
func newGetCmd() *cobra.Command {
1313
cmd := &cobra.Command{
1414
Use: "get <query-id>",
15-
Short: "Get a saved query",
15+
Short: "Fetch a saved Dune query by ID, including SQL and metadata",
16+
Long: "Retrieve SQL, metadata, owner, privacy flags, tags, and execution state for\n" +
17+
"an existing Dune query. Only queries visible to the authenticated user are returned.",
1618
Args: cobra.ExactArgs(1),
1719
RunE: runGet,
1820
}

0 commit comments

Comments
 (0)