Skip to content

Fix CLI issues found testing the MCP parity commands live - #68

Merged
ivpusic merged 2 commits into
mainfrom
ivan/cli-mcp-parity-followups
Nov 20, 2026
Merged

ivpusic merged 2 commits into
mainfrom
ivan/cli-mcp-parity-followups

Conversation

@ivpusic

@ivpusic ivpusic commented Nov 20, 2026

Copy link
Copy Markdown
Member

What & why

Follow-up to #67. Testing the new commands live with a real API key turned up a few places where the CLI reports success, or prints output a script misreads, when it did not do what was asked. This fixes them and two README errors.

  • Verified live against the prod API with a personal key: each fix below was rerun on the built binary.

Changes

  • dataset search -o json printed "results": null when nothing matched; main printed [], so jq '.results[]' broke. It prints [] again.
  • query update --parameters null sent an empty PATCH and printed "Updated query". It now fails and points to '[]' to clear the parameters.
  • query update --temp --archived printed success, but the query ended up not temporary: REST /archive clears is_temp (checked live: --temp alone sets it, a later archive clears it). The combination is now refused before any call.
  • query get -o json printed latest_execution_id: null both when the query never ran and when the MCP lookup failed. On a failed lookup the two keys are now left out; the text output already said "unknown".
  • execution results with shaping flags printed the running state and exited 0 when --timeout passed. It now fails with the state and a hint.
  • viz create/update --options accepts @path and @-, as the README already said, through the same cmdutil.JSONFlag as --config.
  • folder move / move-content refuse --to "" (for example an unset shell variable) instead of sending an empty folder ID.
  • README: --owner-scope and --include-private still filter dataset search through REST; the README said they were deprecated.

Blast radius: CLI users and scripts only. Scripts that relied on the exit code 0 of a timed-out shaped execution results, or on null latest-execution keys after an MCP failure, see a change.

Not changed

  • Unshaped execution results ignores --timeout: the SDK's WaitGetResults only counts errors, not time. That predates Bring the CLI to parity with the Dune MCP server #67; a fix belongs in duneapi-client-go.
  • create-and-run -o json mixes snake_case and camelCase keys (result_preview.executionId, visualization.chartJpegUrl), as does viz create --chart-type -o json, because they pass the MCP result through. Changing it would break anyone parsing it today.
  • Folder writes could not be tested live: the account's folder quota is 0 (402).

Tests

  • go vet ./... and go test -race ./... pass.
  • New regression tests for the empty search results, the two refused query update combinations, query get -o json after a failed lookup, and the shaped timeout. Each fails with its fix reverted.
Agent context
  • Authored in this Amp thread, from a review and live test of Bring the CLI to parity with the Dune MCP server #67.
  • Live run (prod, personal key): dataset search with no hits → []; query update --parameters null and --temp --archived → refused, no calls; folder move abc --to "" → refused; viz update --type counter --options @opts.json → saved options read back identical. Probe query 9161138 is archived.

- dataset search: print "results": [] instead of null when nothing matches.
- query update: refuse --parameters null, which sent an empty update, and
  --temp with --archived, since archiving clears the temp flag.
- query get -o json: leave out the latest execution keys when they could
  not be read, instead of null, which means "never run".
- execution results: fail when a shaped wait times out instead of
  printing the running state with exit 0.
- viz create/update: --options accepts @path and @-, as the README says.
- folder move/move-content: refuse an empty --to.
- README: --owner-scope and --include-private still work in dataset search.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1f35e-4422-71d4-a903-056e89e15547

@norbertdurcansk norbertdurcansk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, with one nit. Each fix matches the description and each regression test exercises the behavior it names; CI is green.

Question: the README query update row doesn't mention that --temp and --archived are mutually exclusive. The runtime error is probably enough; fine to leave.

Comment thread cmd/visualization/update.go Resolved
On update it would have replaced the visualization's options with null, since
the update request sends options without omitempty; on create it sent none.
Options are now parsed before any API call.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1f35e-4422-71d4-a903-056e89e15547
Co-authored-by: Amp <amp@ampcode.com>
@ivpusic
ivpusic merged commit 199766f into main Nov 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants