Skip to main content
Glama
metabase-mcp

metabase-mcp

by livingroot

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

NameRequiredDescriptionDefault
sqlNoNew SQL query body
nameNoNew display name
card_idYesCard ID to update
displayNoVisualization type. Common values: 'table' | 'line' | 'bar' | 'area' | 'pie' | 'scalar' | 'smartscalar' | 'row' | 'combo' | 'scatter' | 'funnel' | 'waterfall' | 'gauge' | 'progress' | 'map' | 'pivot'. Example: 'bar'
tag_typesNoOverride 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_idNoRequired when updating sql — the database the SQL runs against
descriptionNoNew description
ref_card_idNoCard ID to copy template-tag types from. Use this to restore broken filter types by providing a reference card with correct types.
tag_configsNoFull 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_settingsNoVisualization settings object. For bar/line charts use graph.dimensions and graph.metrics to set axes. Example: {"graph.dimensions": ["День"], "graph.metrics": ["Общая сумма"]}

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full behavioral burden and does well: it discloses partial-update semantics (untouched fields are preserved), the database_id dependency for SQL edits, and that widget_type is validated against the target field before saving – a real pre-save side effect. It does not cover permissions, whether changing SQL invalidates existing dashboard filters, or what the call returns, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, front-loaded with the core mutation, then progressively narrower caveats (database_id, ref_card_id, widget_type). No filler, no restatement of the tool name, and every sentence carries a distinct operational fact.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter mutation tool with nested objects and no annotations, the description covers the non-obvious footguns that an agent would otherwise get wrong (database_id with sql, tag-copy semantics, widget auto-detection). The one gap is that with no output schema, it never says what the call returns or what state the card ends in.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so a baseline of 3 is guaranteed, and the description adds genuine meaning on top: the sql/database_id coupling, the ref_card_id repair use case, and the omitted-widget_type auto-detection rule. Only display and visualization_settings are left to the schema alone, which is acceptable given their inline documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource ('Update a saved question's name, description, or SQL') and adds the immediate scope boundary ('Only the provided fields are changed'). This is enough to distinguish it from cards_create, cards_get, and cards_execute without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives conditional routing for parameters – database_id is required only when updating sql, ref_card_id is for copying or repairing template-tag types, and widget_type is auto-detected when omitted. It doesn't explicitly contrast with sibling tools such as cards_create or cards_execute, but the update-only framing makes the intended use unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.