Repository navigation
Add dune query results for the MCP's getLatestQueryResult - #85
Merged
Merged
Conversation
core#8349/#8443 added getLatestQueryResult to the Dune MCP server: a saved query's latest stored result, without running it. 'dune query results <query-id>' calls it, shows when the run happened and its parameters, and prints the tool's notice when no result is stored or rows are withheld for licensed datasets. It goes through the MCP, not the REST results endpoint, so the MCP's licensed-data withholding applies. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a2147b-3c2e-76b3-aeaf-0aafbe53d879
norbertdurcansk
approved these changes
Nov 30, 2026
norbertdurcansk
left a comment
Contributor
There was a problem hiding this comment.
Approved, with suggestions. The command is small and fits the existing pattern, and the tests check that only the flags the user sets are sent. Two non-blocking issues: a failed run returns exit code 0 with -o json, and withheld rows print a misleading 0 of 0 rows line. Plus one question about the withholding behavior.
…n rows are withheld (#86) Amp-Thread-ID: https://ampcode.com/threads/T-01a2147b-3c2e-76b3-aeaf-0aafbe53d879 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.
Adds
dune query results <query-id> [--limit] [--offset], matching the Dune MCP'sgetLatestQueryResult(duneanalytics/core#8349, kept in #8443, live in prod): the latest stored result of a saved query, without running it or using execution credits.Impact map
query resultsgetLatestQueryResultReview notes
ResultsByQueryID, so licensed datasets stay withheld exactly as in the MCP; the tool's notice is printed instead of rows.Executed atand the run's parameters, since the result can be old or use non-default values. No stored result prints the tool's notice and the query link (exit 0). A failed stored run is an error.--limit/--offsetthe user sets are sent, so server defaults (100 rows) apply.Testing
go test ./...andgo vet ./...pass.No visual surface: CLI only.