---
title: "edit_dashboard_widget"
description: "Edit an existing widget in a dashboard."
sidebarTitle: "edit_dashboard_widget"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Edit an existing widget in a dashboard.

<Warning>
  **Destructive · Writes data · Idempotent · Calls external systems.** This tool can modify or delete data. Review the arguments before letting an agent call it.
</Warning>

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `acknowledge` | boolean | No | Set to true after user approves continuing past the edit limit. |
| `dashboard_uid` | string | Yes | Dashboard UID |
| `h` | number | No | New grid height (optional) |
| `w` | number | No | New grid width (optional) |
| `widget_id` | string | Yes | Widget ID within the dashboard (the 'i' field from get_dashboard layout) |
| `widget_json` | string | Yes | JSON string of the new widget data section |
| `x` | number | No | New grid x position (optional — preserves current if omitted) |
| `y` | number | No | New grid y position (optional) |

## Example arguments

Illustrative arguments an agent supplies when calling this tool:

```json
{
  "dashboard_uid": "string",
  "widget_id": "string",
  "widget_json": "string"
}
```

## Description

```text
Replaces the widget data section. Position (x/y/w/h) is preserved unless explicitly provided.

Prerequisite: Use query_metrics with SHOW MEASUREMENTS and SHOW FIELD KEYS if changing query fields.

Workflow: get_dashboard → edit_dashboard_widget → get_dashboard (verify).
```

## Related

- [`query_metrics`](/mcp/tools/metrics/query_metrics)
- [`get_dashboard`](/mcp/tools/dashboard/get_dashboard)

## What's next?

<Columns cols={2}>
  <Card title="All MCP tools" icon="robot" href="/mcp/tools/overview">
    Browse the full tool reference by category.
  </Card>
  <Card title="Connect a client" icon="plug" href="/mcp/connect">
    Point Claude, Cursor, or Claude Code at the server.
  </Card>
</Columns>
