cards_update
Updates a saved Metabase question's metadata or SQL, changing only the fields you provide. Use it to rename questions, edit queries, adjust visualizations, or repair template-tag filter types.
Instructions
Update a saved question's name, description, or SQL. Only the provided fields are changed. Requires database_id when updating sql. Pass ref_card_id to copy template-tag types from another card (fixes broken filter types). Field Filter widget_type is auto-detected from the target field's type when omitted and validated against it before saving.
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": {
"card_id": "<card_id>"
},
"name": "cards_update"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | No | New SQL query body | |
| name | No | New display name | |
| card_id | Yes | Card ID to update | |
| display | No | Visualization type. Common values: 'table' | 'line' | 'bar' | 'area' | 'pie' | 'scalar' | 'smartscalar' | 'row' | 'combo' | 'scatter' | 'funnel' | 'waterfall' | 'gauge' | 'progress' | 'map' | 'pivot'. Example: 'bar' | |
| tag_types | No | Override the Metabase type for specific {{template_tag}} variables when updating SQL. Map of tag name to type: 'text' | 'date' | 'number' | 'dimension'. Takes priority over source-card types. Example: {"start_date": "date"} | |
| database_id | No | Required when updating sql — the database the SQL runs against | |
| description | No | New description | |
| ref_card_id | No | Card ID to copy template-tag types from. Use this to restore broken filter types by providing a reference card with correct types. | |
| tag_configs | No | Full tag configuration for {{template_tag}} variables. Supersedes tag_types. Use for dimension tags: set type='dimension', field_id=<id> to create a working dashboard filter; widget_type is auto-detected from the field's type when omitted and validated against it before saving. Example: {"sprint_name": {"type": "dimension", "field_id": 12694}} | |
| visualization_settings | No | Visualization settings object. For bar/line charts use graph.dimensions and graph.metrics to set axes. Example: {"graph.dimensions": ["День"], "graph.metrics": ["Общая сумма"]} |