Skip to content

Improve dashboard and card parameter workflows#30

Merged
andreagrandi merged 1 commit into
masterfrom
dashboard-card-parameter-workflows
May 21, 2026
Merged

Improve dashboard and card parameter workflows#30
andreagrandi merged 1 commit into
masterfrom
dashboard-card-parameter-workflows

Conversation

@andreagrandi

Copy link
Copy Markdown
Owner

Summary

Closes #14. Running parameterized cards and dashboard cards previously required knowing parameter IDs and values up front, with no way to discover them. This adds discovery commands and makes failed runs point at the exact command to inspect valid parameters.

Changes

  • card params <id> — lists the parameters a saved question accepts (from native template tags). card and snippet template tags are excluded since they reference other queries rather than taking a user value. Table output ends with a ready-to-edit card run ... --param name=<value> line.
  • dashboard params list <dashboard-id> — lists a dashboard's parameters, types, and how many cards each filters; completes the dashboard params group (list / values / search).
  • Actionable run errors — a failed parameterized run now surfaces a ParameterizedQueryError carrying the precise discovery command (mb-cli card params <id> / mb-cli dashboard params list <id>), shown in both text and --error-format json output.
  • Metabase rejects invalid card parameters with HTTP 500 (not 400), so the error wrapping keys off whether the caller supplied --param flags rather than the status code.
  • Updates the embedded agent context with the new commands, a parameterized-workflow section, and examples.

Testing

  • make fmt, make vet, make build, make test all clean
  • New tests cover parameter discovery (cards with/without parameters, dashboards) and invalid-parameter paths for both card run and dashboard run-card
  • Smoke tested against a live Metabase instance: card params, card run (valid + invalid params), dashboard params list, dashboard run-card invalid-param path

Changelog

Entry added under ## [Unreleased].

Add `card params` and `dashboard params list` so users can discover the
parameters a saved question or dashboard accepts before running it,
instead of digging through `card get --full` JSON or guessing IDs.

Failed parameterized runs now surface a ParameterizedQueryError carrying
the exact discovery command to run next (`mb-cli card params <id>` or
`mb-cli dashboard params list <id>`), shown in both text and JSON error
output. Metabase rejects invalid card parameters with a 500 rather than
a 400, so this keys off whether the caller supplied parameters rather
than the status code.

Closes #14
@andreagrandi andreagrandi merged commit 8e18559 into master May 21, 2026
7 checks passed
@andreagrandi andreagrandi deleted the dashboard-card-parameter-workflows branch May 21, 2026 20:28
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.

Improve dashboard and card parameter workflows

1 participant