Skip to main content
Glama

add_widget

Destructive

Adds a saved query's visualization to a dashboard as a widget, placing it below existing widgets and returning the widget and dashboard IDs.

Instructions

Add a saved query's visualization onto a dashboard as a widget. Behavior: places the widget below the existing ones (half-width widgets pair up side by side) and returns its id and dashboard_id. Usage: get the dashboard_id from list_dashboards or create_dashboard, and the visualization_id from get_query (each saved query exposes its visualizations) or from create_visualization for a new chart. This is how you build up a dashboard after creating it.

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>",
      "visualization_id": "<visualization_id>"
    },
    "name": "add_widget"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoOptional text/markdown caption shown on the widget
widthNoWidget width: 1 = half row, 2 = full row (default 1)
dashboard_idYesID of the dashboard to add the widget to (from list_dashboards/create_dashboard)
visualization_idYesID of the visualization to embed (from get_query's visualizations list or create_visualization)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.5.0
    • changedInput schema / properties / visualization_id / description
      Previous value: -"ID of the visualization to embed (from get_query's visualizations list)"New value: +"ID of the visualization to embed (from get_query's visualizations list or create_visualization)"
  2. Changed4 schema fields changedv3.2.0
    • changedInput schema / properties / dashboard_id / description
      Previous value: -"Dashboard ID"New value: +"ID of the dashboard to add the widget to (from list_dashboards/create_dashboard)"
    • changedInput schema / properties / text / description
      Previous value: -"Widget text"New value: +"Optional text/markdown caption shown on the widget"
    • changedInput schema / properties / visualization_id / description
      Previous value: -"Visualization ID (from get_query's visualizations)"New value: +"ID of the visualization to embed (from get_query's visualizations list)"
    • changedInput schema / properties / width / description
      Previous value: -"Widget width (1 = half, 2 = full)"New value: +"Widget width: 1 = half row, 2 = full row (default 1)"
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond the lone destructiveHint annotation by disclosing placement behavior (appended below existing widgets, half-width widgets paired side by side) and the return shape (id and dashboard_id). It does not address permissions or whether existing widget layout can be disturbed, which matters given destructiveHint=true.

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

Conciseness4/5

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

Front-loaded with the action and its behavior, then prerequisites. Slightly repetitive: the usage sentence about IDs and the closing 'build up a dashboard' line overlap in intent, so one of them is not fully earning its place.

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?

There is no output schema, but the description compensates by naming the returned fields, and both required parameters are sourced. The gaps are edge cases: duplicate-visualization handling and what the destructiveHint flag implies for existing widgets.

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 already 100%, so 3 is the baseline; the description earns an extra point by explaining the pairing consequence of width=1 versus full-row placement. The optional 'text' caption parameter is left to the schema entirely.

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 specific verb and resource chain: adds a saved query's visualization onto a dashboard as a widget. This clearly distinguishes it from siblings like create_visualization (which makes the chart) and create_dashboard (which makes the container).

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

Usage Guidelines5/5

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

Explicitly names prerequisites and where each ID comes from (list_dashboards/create_dashboard for dashboard_id, get_query or create_visualization for visualization_id). The closing line 'This is how you build up a dashboard after creating it' fixes the sequencing relative to its siblings.

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