Repository navigation
Conversation
dataset search and search-by-contract fetched column schemas but their text output dropped them, so agents had to use -o json to write SQL. Text output now lists each table's columns under COLUMNS: the Dune MCP's top-3 columns, or the API schema with --include-schema. Every command with -o now also takes --compact, which prints JSON on one line. Indented JSON was about 60% larger than the same data compact. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f9a9-af80-7151-a7e6-0056ca994479 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
dune dataset searchandsearch-by-contractnow list each table's columns in their default text output, under aCOLUMNSsection. Before, the command fetched the columns but the text output threw them away, so an agent had to switch to-o jsonto write SQL.Every command with
-oalso gets--compact, which prints JSON on one line.In a benchmark of Mentat (Dune's Centaur agent) running the CLI against the Dune MCP server, table search with columns took 2,979 tokens through
-o jsonagainst MCP's 1,832. It now takes about 656 tokens as text, or 1,832 as compact JSON.Architecture
Output-only change: no API requests or JSON fields change.
cmd/dataset/columns.go(new): turns a result's columns intoname typepairs. It reads the Dune MCP's top-3columnslist first, then falls back to the API's--include-schemaschema.fields. Both commands print one line per table that has columns.output/output.go:AddFormatFlagalso registers--compact.PrintJSONandPrintRawJSONnow take the*cobra.Commandinstead of anio.Writer, write tocmd.OutOrStdout(), and drop indentation with--compact. All 49 call sites passedcmd.OutOrStdout()already; the change there is mechanical (wtocmd). Indented JSON is unchanged without the flag.go test ./...passes. New tests check exact compact output forPrintJSONandPrintRawJSON, and theCOLUMNStext for both commands, including that MCP columns take priority over the API schema (a test fails if the order is swapped). Ran the built binary against the live API: both commands print real columns, and--compactbrings search JSON from 11,919 to 7,331 characters.make lintalready fails onmain(e.g.tracking/tracking_test.go). This PR adds no new findings.dataset searchsee new lines after the table. JSON output is unchanged unless--compactis passed. Mentat runs the latest release, so it picks this up within a day of the next release.Agent context
go build -o /tmp/dune ./cmd && /tmp/dune dataset search --query "USDC transfers ethereum" --limit 3and... -o json --compact | wc -c