dashboards_add_filter
Add a filter parameter to a dashboard, set its type and dropdown source, then reuse the unique parameter ID to wire it to cards.
Instructions
Add a filter parameter to a dashboard. Provide a unique parameter_id string; reuse the same parameter_id in dashboards_connect_filter to wire it to a card. Use values_source_type to control the dropdown source: 'static-list' for a fixed list, 'card' for values from a saved question, 'fields' for values from connected fields (requires a dimension tag_config on the card).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"dashboard_id": "<dashboard_id>",
"parameter_id": "<parameter_id>",
"name": "<name>",
"type": "<type>"
},
"name": "dashboards_add_filter"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Display name for the filter, e.g. 'Status' | |
| slug | No | URL slug for the filter. Optional — derived from name; falls back to parameter_id when the name has no Latin letters/digits (e.g. Cyrillic). | |
| type | Yes | Filter type. 'temporal-unit' is the 'Time grouping' widget: connect it to a card's 'temporal-unit' template tag (native SQL) to switch day/week/month/etc. | |
| default | No | Default value, e.g. "week" for a temporal-unit filter or "2026-01-01~2026-12-31" for date/range. | |
| dashboard_id | Yes | Dashboard ID | |
| parameter_id | Yes | Unique string ID for this parameter (reuse it verbatim in dashboards_connect_filter) | |
| values_source_type | No | Where dropdown values come from. 'static-list': fixed list (provide values_source_config.values). 'card': from a saved question (provide values_source_config.card_id + value_field). 'fields': auto-derive from connected dimension field — equivalent to omitting this parameter (Metabase does not accept 'fields' as an API value; the server omits it automatically). Omit to let Metabase derive values from the connected field. | |
| values_source_config | No | Config for the values source. For 'static-list': {"values": [["opt1"], ["opt2"]]}. For 'card': {"card_id": 123, "value_field": ["field", <field_id>, null]}. For 'fields': {} or omit. |