add_dashboard_widget

Add a widget to a dashboard.

Add a widget to a dashboard.

Destructive · Writes data · Calls external systems. This tool can modify or delete data. Review the arguments before letting an agent call it.

Parameters

FieldTypeRequiredDescription
acknowledgebooleanNoSet to true after user approves continuing past the edit limit. NEVER set without explicit user approval.
dashboard_uidstringYesDashboard UID (from list_dashboards or create_dashboard)
hnumberNoGrid height in rows. Omit for type default.
previewbooleanNoDry-run mode: validate, normalize, and auto-position without PATCHing the dashboard or burning edit budget. Returns ASCII grid + normalized data + warnings.
wnumberNoGrid width in columns. Omit for type default.
widget_jsonstringYesJSON string of the widget data section (from get_widget_template, filled with real values, without _metadata)
xnumberNoGrid x position (0-23). Omit for auto-position.
ynumberNoGrid y position. Omit for auto-position (appends to bottom).

Example arguments

Illustrative arguments an agent supplies when calling this tool:

{
  "dashboard_uid": "string",
  "widget_json": "string"
}

Description

Validates the widget, generates a unique ID, auto-positions it, and appends to the dashboard layout via PATCH.

Prerequisite: Use query_metrics with SHOW MEASUREMENTS and SHOW FIELD KEYS to discover the InfluxDB schema before constructing widget queries. Placeholder values will be REJECTED.

Workflow: get_widget_template → fill with real values → validate_widget → add_dashboard_widget → get_dashboard (verify).

What's next?

All MCP tools

Browse the full tool reference by category.

Connect a client

Point Claude, Cursor, or Claude Code at the server.

Last updated on