Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(dashboards): clarify tile layout MCP tools (#106326)

Matt Puae4e586203974
diff --git a/docs/published/handbook/engineering/ai/implementing-mcp-tools.md b/docs/published/handbook/engineering/ai/implementing-mcp-tools.md
index 2fd9e1f0abb6..c88d19b22d64 100644
--- a/docs/published/handbook/engineering/ai/implementing-mcp-tools.md
+++ b/docs/published/handbook/engineering/ai/implementing-mcp-tools.md
@@ -335,6 +335,9 @@ Product teams own their definitions and control which operations are exposed as
action_label: Short action label # optional, defaults to tool title
```
+ For a PATCH action with required request fields, set `param_overrides.<field>.required: true`.
+ The MCP tool then requires the field, even when the generated PATCH body marks it optional.
+
Unknown keys are rejected at build time (Zod `.strict()`) to catch typos early.
For generated list apps, `generate:ui-apps` also checks `detail_tool` and the
diff --git a/products/dashboards/mcp/tools.yaml b/products/dashboards/mcp/tools.yaml
index 67d9ff5b3ab9..041349441b78 100644
--- a/products/dashboards/mcp/tools.yaml
+++ b/products/dashboards/mcp/tools.yaml
@@ -144,9 +144,11 @@ tools:
Add a dashboard tile. Set `type` to text or image. Use Markdown headings, dividers, or notes for a text
tile. The desktop grid is 12 columns wide. A typical text heading uses a thin full-width banner (e.g.
`layouts.sm = {x: 0, y: 0, w: 12, h: 1}`). If `layouts` is omitted, the dashboard places the tile at the
- bottom with the default size. Use dashboard-reorder-tiles for precise placement. An image tile body must
- contain exactly one Markdown image, such as `![Accessible description](https://example.com/image.png)`. The
- image URL must be reachable by dashboard viewers. Use `layouts` to control the tile size.
+ bottom with the default size. Use `layouts` to control the size and placement of this text or image tile. To
+ lay out insight tiles or create a mixed layout, first call dashboard-get to get tile IDs, then use
+ dashboard-update with complete `layouts.sm` boxes. An image tile body must contain exactly one Markdown
+ image, such as `![Accessible description](https://example.com/image.png)`. The image URL must be reachable
+ by dashboard viewers.
dashboard-delete:
operation: dashboards_destroy
enabled: true
@@ -318,7 +320,9 @@ tools:
dashboard-get to see current tile IDs. By default existing tile widths and heights are preserved. Use the
layout parameter only when every tile should use the same size: `two_column` makes every tile 6-wide,
`three_column` makes every tile 4-wide, and `full_width` makes every tile 12-wide. For a mixed layout, set
- each tile's `layouts` with dashboard-update instead.
+ each tile's `layouts` with dashboard-update instead. This tool repacks only the tiles in `tile_order`. To
+ repack the whole dashboard, include every tile ID. Tiles omitted from `tile_order` keep their positions and
+ can overlap the repacked tiles. This tool does not set different sizes or positions for individual tiles.
dashboard-saved-views-create:
operation: dashboard_saved_views_create
enabled: false
@@ -417,6 +421,29 @@ tools:
param_overrides:
id:
cast: string-int
+ dashboard-transfer-tile:
+ operation: dashboards_move_tile_partial_update
+ enabled: true
+ scopes:
+ - dashboard:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: true
+ enrich_url: '{id}'
+ title: Transfer dashboard tile
+ description: >
+ Transfer a tile from the source dashboard to another dashboard. This does not resize or reposition the tile.
+ To resize or reposition tiles on a dashboard, use dashboard-update. Provide to_dashboard (destination
+ dashboard ID) and tile.id (tile ID from dashboard-get). Works for insight, text, and widget tiles; widget
+ tiles require the dashboard-widgets feature flag on the project.
+ param_overrides:
+ id:
+ cast: string-int
+ tile:
+ required: true
+ to_dashboard:
+ required: true
dashboard-update:
operation: dashboards_partial_update
enabled: true
@@ -429,21 +456,21 @@ tools:
enrich_url: '{id}'
title: Update dashboard
description: >
- Update an existing dashboard by ID. Can update name, description, pinned status, tags, filters, and
- restriction level. To resize or move tiles, pass `tiles` with each tile's `id` from dashboard-get and a
- `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type, insight tiles
- included. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and height for its
- content and importance. Width can be any whole number from 1 to 12, subject to the tile's minimum size.
- Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's whole layout, so
- send a complete box, not just the value you want to change. Boxes are stored as sent and overlaps are not
- resolved, so plan the whole grid and send every tile you move in one request. Only set `layouts.sm`: the
- dashboard derives the mobile layout from the sm order and heights. Use dashboard-reorder-tiles only for a
- whole-dashboard repack where every tile should use the same size. The same `tiles` array also updates a
- widget tile's own settings: add a nested `widget.id` from dashboard-get plus the fields to change (`config`,
- `name`, `description`). That is the same PATCH path the UI uses, but prefer dashboard-widgets-batch-update,
- which takes just a tile_id per widget. To add new widget tiles to this dashboard, use
- dashboard-widgets-batch-add instead. The returned tiles omit insight results to save context — use
- dashboard-insights-run to fetch the actual data for each insight.
+ Resize, reposition, or update dashboard tiles. It can also update the dashboard name, description, pinned
+ status, tags, filters, and restriction level. After you create or add insight tiles, call dashboard-get to
+ get their tile IDs, then pass `tiles` with each tile's `id` and a `layouts` object holding x, y, w, and h
+ per breakpoint. This works for every tile type, including insight tiles. The desktop grid (`layouts.sm`) is
+ 12 columns wide. Set each tile's width and height for its content and importance. Width can be any whole
+ number from 1 to 12, subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show
+ hierarchy. A write replaces the tile's whole layout, so send a complete box, not just the value you want to
+ change. Boxes are stored as sent and overlaps are not resolved, so plan the whole grid and send every tile
+ you move in one request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order
+ and heights. Use dashboard-reorder-tiles only to repack the whole dashboard with preserved or uniform tile
+ sizes. The same `tiles` array also updates a widget tile's own settings: add a nested `widget.id` from
+ dashboard-get plus the fields to change (`config`, `name`, `description`). That is the same PATCH path the
+ UI uses, but prefer dashboard-widgets-batch-update, which takes just a tile_id per widget. To add new widget
+ tiles to this dashboard, use dashboard-widgets-batch-add instead. The returned tiles omit insight results to
+ save context — use dashboard-insights-run to fetch the actual data for each insight.
exclude_params:
- creation_mode
- effective_restriction_level
@@ -679,24 +706,6 @@ tools:
dashboards-move-tile-create:
operation: dashboards_move_tile_create
enabled: false
- dashboards-move-tile-partial-update:
- operation: dashboards_move_tile_partial_update
- enabled: true
- scopes:
- - dashboard:write
- annotations:
- readOnly: false
- destructive: false
- idempotent: true
- enrich_url: '{id}'
- title: Move dashboard tile
- description: >
- Move a tile from the source dashboard (path ID) to another dashboard. Provide to_dashboard (destination
- dashboard ID) and tile.id (tile ID from dashboard-get). Works for insight, text, and widget tiles; widget
- tiles require the dashboard-widgets feature flag on the project.
- param_overrides:
- id:
- cast: string-int
dashboards-stream-tiles-retrieve:
operation: dashboards_stream_tiles_retrieve
enabled: false
diff --git a/products/dashboards/skills/building-a-dashboard/SKILL.md b/products/dashboards/skills/building-a-dashboard/SKILL.md
index 437e9786d639..497865953b22 100644
--- a/products/dashboards/skills/building-a-dashboard/SKILL.md
+++ b/products/dashboards/skills/building-a-dashboard/SKILL.md
@@ -51,14 +51,16 @@ Prefer reusing existing insights over recreating them.
## Assemble the dashboard
- New dashboard: `dashboard-create` with a short (3–7 word) name and a concise description, then add the insight tiles.
-- Existing dashboard: `dashboard-update`. Adding, replacing, or removing insights means sending the full intended set of
- tiles — insights you omit are removed, so include the ones you want to keep.
-- Layout: by default preserve existing tile placement. Use `dashboard-update` to plan each tile independently on the
- 12-column grid. Tile widths can be any whole number from 1 to 12, subject to each tile's minimum size. Use wider
- tiles for primary charts and smaller tiles for supporting metrics. Mixed rows such as 8 plus 4 or 6 plus 6 can show
- that hierarchy.
+- Existing dashboard: use `dashboard-update` to add insight tiles or change their layout. Tiles omitted from a PATCH
+ remain on the dashboard. To remove a tile, find its ID with `dashboard-get`, then use `dashboard-delete-tile`.
+ To replace an insight tile, add the new insight and delete the old tile.
+- Layout: after you add insight tiles, call `dashboard-get` again to get their tile IDs. Use `dashboard-update` to plan
+ each tile independently on the 12-column grid. Tile widths can be any whole number from 1 to 12, subject to each
+ tile's minimum size. Use wider tiles for primary charts and smaller tiles for supporting metrics. Mixed rows such as
+ 8 plus 4 or 6 plus 6 can show that hierarchy.
- Reflow: use `dashboard-reorder-tiles` only when the user explicitly asks to reorder tiles or make every tile the
- same size. Its layout modes give every tile a uniform box. For mixed widths or heights, use `dashboard-update`.
+ same size. Include every tile ID from `dashboard-get`; omitted tiles keep their positions and can overlap moved tiles.
+ Its layout modes give every listed tile a uniform box. For mixed widths or heights, use `dashboard-update`.
- Tile sizes: send `tiles` through `dashboard-update` with each tile's `id` and a complete `layouts.sm` box. `sm` is
required whenever you send `layouts`, because a write replaces the tile's whole layout. `sm` controls desktop
placement, and the dashboard derives the mobile layout from the `sm` order and heights, so set only `sm`. The API
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 4ec90cb59a1c..722e08422d69 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -2898,7 +2898,7 @@
}
},
"dashboard-create-tile": {
- "description": "Add a dashboard tile. Set `type` to text or image. Use Markdown headings, dividers, or notes for a text tile. The desktop grid is 12 columns wide. A typical text heading uses a thin full-width banner (e.g. `layouts.sm = {x: 0, y: 0, w: 12, h: 1}`). If `layouts` is omitted, the dashboard places the tile at the bottom with the default size. Use dashboard-reorder-tiles for precise placement. An image tile body must contain exactly one Markdown image, such as `![Accessible description](https://example.com/image.png)`. The image URL must be reachable by dashboard viewers. Use `layouts` to control the tile size.",
+ "description": "Add a dashboard tile. Set `type` to text or image. Use Markdown headings, dividers, or notes for a text tile. The desktop grid is 12 columns wide. A typical text heading uses a thin full-width banner (e.g. `layouts.sm = {x: 0, y: 0, w: 12, h: 1}`). If `layouts` is omitted, the dashboard places the tile at the bottom with the default size. Use `layouts` to control the size and placement of this text or image tile. To lay out insight tiles or create a mixed layout, first call dashboard-get to get tile IDs, then use dashboard-update with complete `layouts.sm` boxes. An image tile body must contain exactly one Markdown image, such as `![Accessible description](https://example.com/image.png)`. The image URL must be reachable by dashboard viewers.",
"category": "Dashboards",
"feature": "dashboards",
"summary": "Create dashboard tile",
@@ -2968,7 +2968,7 @@
}
},
"dashboard-reorder-tiles": {
- "description": "Reorder tiles on a dashboard by providing an array of tile IDs in the desired display order. First, use dashboard-get to see current tile IDs. By default existing tile widths and heights are preserved. Use the layout parameter only when every tile should use the same size: `two_column` makes every tile 6-wide, `three_column` makes every tile 4-wide, and `full_width` makes every tile 12-wide. For a mixed layout, set each tile's `layouts` with dashboard-update instead.",
+ "description": "Reorder tiles on a dashboard by providing an array of tile IDs in the desired display order. First, use dashboard-get to see current tile IDs. By default existing tile widths and heights are preserved. Use the layout parameter only when every tile should use the same size: `two_column` makes every tile 6-wide, `three_column` makes every tile 4-wide, and `full_width` makes every tile 12-wide. For a mixed layout, set each tile's `layouts` with dashboard-update instead. This tool repacks only the tiles in `tile_order`. To repack the whole dashboard, include every tile ID. Tiles omitted from `tile_order` keep their positions and can overlap the repacked tiles. This tool does not set different sizes or positions for individual tiles.",
"category": "Dashboards",
"feature": "dashboards",
"summary": "Reorder dashboard tiles",
@@ -3023,8 +3023,22 @@
"readOnlyHint": false
}
},
+ "dashboard-transfer-tile": {
+ "description": "Transfer a tile from the source dashboard to another dashboard. This does not resize or reposition the tile. To resize or reposition tiles on a dashboard, use dashboard-update. Provide to_dashboard (destination dashboard ID) and tile.id (tile ID from dashboard-get). Works for insight, text, and widget tiles; widget tiles require the dashboard-widgets feature flag on the project.",
+ "category": "Dashboards",
+ "feature": "dashboards",
+ "summary": "Transfer dashboard tile",
+ "title": "Transfer dashboard tile",
+ "required_scopes": ["dashboard:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"dashboard-update": {
- "description": "Update an existing dashboard by ID. Can update name, description, pinned status, tags, filters, and restriction level. To resize or move tiles, pass `tiles` with each tile's `id` from dashboard-get and a `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type, insight tiles included. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and height for its content and importance. Width can be any whole number from 1 to 12, subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's whole layout, so send a complete box, not just the value you want to change. Boxes are stored as sent and overlaps are not resolved, so plan the whole grid and send every tile you move in one request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use dashboard-reorder-tiles only for a whole-dashboard repack where every tile should use the same size. The same `tiles` array also updates a widget tile's own settings: add a nested `widget.id` from dashboard-get plus the fields to change (`config`, `name`, `description`). That is the same PATCH path the UI uses, but prefer dashboard-widgets-batch-update, which takes just a tile_id per widget. To add new widget tiles to this dashboard, use dashboard-widgets-batch-add instead. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.",
+ "description": "Resize, reposition, or update dashboard tiles. It can also update the dashboard name, description, pinned status, tags, filters, and restriction level. After you create or add insight tiles, call dashboard-get to get their tile IDs, then pass `tiles` with each tile's `id` and a `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type, including insight tiles. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and height for its content and importance. Width can be any whole number from 1 to 12, subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's whole layout, so send a complete box, not just the value you want to change. Boxes are stored as sent and overlaps are not resolved, so plan the whole grid and send every tile you move in one request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use dashboard-reorder-tiles only to repack the whole dashboard with preserved or uniform tile sizes. The same `tiles` array also updates a widget tile's own settings: add a nested `widget.id` from dashboard-get plus the fields to change (`config`, `name`, `description`). That is the same PATCH path the UI uses, but prefer dashboard-widgets-batch-update, which takes just a tile_id per widget. To add new widget tiles to this dashboard, use dashboard-widgets-batch-add instead. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.",
"category": "Dashboards",
"feature": "dashboards",
"summary": "Update dashboard",
@@ -3124,20 +3138,6 @@
"readOnlyHint": true
}
},
- "dashboards-move-tile-partial-update": {
- "description": "Move a tile from the source dashboard (path ID) to another dashboard. Provide to_dashboard (destination dashboard ID) and tile.id (tile ID from dashboard-get). Works for insight, text, and widget tiles; widget tiles require the dashboard-widgets feature flag on the project.",
- "category": "Dashboards",
- "feature": "dashboards",
- "summary": "Move dashboard tile",
- "title": "Move dashboard tile",
- "required_scopes": ["dashboard:write"],
- "annotations": {
- "destructiveHint": false,
- "idempotentHint": true,
- "openWorldHint": true,
- "readOnlyHint": false
- }
- },
"data-catalog-certification-certify-execute": {
"description": "Step 2 of 2 for certify source. Verifies the confirmation_hash from -prepare and the literal \"confirm\" string typed by the user, then performs the action. ONLY call this after the user has explicitly typed \"confirm\" in chat. Original action: Mark a table or view as certified (prefer this source), addressed by the certification id returned by data-catalog-certification-propose — create the proposal first if none exists. Requires human typed confirmation.",
"category": "Data catalog",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index cc3fcedb1d6e..6102c2c3f274 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -2913,7 +2913,7 @@
}
},
"dashboard-create-tile": {
- "description": "Add a dashboard tile. Set `type` to text or image. Use Markdown headings, dividers, or notes for a text tile. The desktop grid is 12 columns wide. A typical text heading uses a thin full-width banner (e.g. `layouts.sm = {x: 0, y: 0, w: 12, h: 1}`). If `layouts` is omitted, the dashboard places the tile at the bottom with the default size. Use dashboard-reorder-tiles for precise placement. An image tile body must contain exactly one Markdown image, such as `![Accessible description](https://example.com/image.png)`. The image URL must be reachable by dashboard viewers. Use `layouts` to control the tile size.",
+ "description": "Add a dashboard tile. Set `type` to text or image. Use Markdown headings, dividers, or notes for a text tile. The desktop grid is 12 columns wide. A typical text heading uses a thin full-width banner (e.g. `layouts.sm = {x: 0, y: 0, w: 12, h: 1}`). If `layouts` is omitted, the dashboard places the tile at the bottom with the default size. Use `layouts` to control the size and placement of this text or image tile. To lay out insight tiles or create a mixed layout, first call dashboard-get to get tile IDs, then use dashboard-update with complete `layouts.sm` boxes. An image tile body must contain exactly one Markdown image, such as `![Accessible description](https://example.com/image.png)`. The image URL must be reachable by dashboard viewers.",
"category": "Dashboards",
"feature": "dashboards",
"summary": "Create dashboard tile",
@@ -2983,7 +2983,7 @@
}
},
"dashboard-reorder-tiles": {
- "description": "Reorder tiles on a dashboard by providing an array of tile IDs in the desired display order. First, use dashboard-get to see current tile IDs. By default existing tile widths and heights are preserved. Use the layout parameter only when every tile should use the same size: `two_column` makes every tile 6-wide, `three_column` makes every tile 4-wide, and `full_width` makes every tile 12-wide. For a mixed layout, set each tile's `layouts` with dashboard-update instead.",
+ "description": "Reorder tiles on a dashboard by providing an array of tile IDs in the desired display order. First, use dashboard-get to see current tile IDs. By default existing tile widths and heights are preserved. Use the layout parameter only when every tile should use the same size: `two_column` makes every tile 6-wide, `three_column` makes every tile 4-wide, and `full_width` makes every tile 12-wide. For a mixed layout, set each tile's `layouts` with dashboard-update instead. This tool repacks only the tiles in `tile_order`. To repack the whole dashboard, include every tile ID. Tiles omitted from `tile_order` keep their positions and can overlap the repacked tiles. This tool does not set different sizes or positions for individual tiles.",
"category": "Dashboards",
"feature": "dashboards",
"summary": "Reorder dashboard tiles",
@@ -3038,8 +3038,22 @@
"readOnlyHint": false
}
},
+ "dashboard-transfer-tile": {
+ "description": "Transfer a tile from the source dashboard to another dashboard. This does not resize or reposition the tile. To resize or reposition tiles on a dashboard, use dashboard-update. Provide to_dashboard (destination dashboard ID) and tile.id (tile ID from dashboard-get). Works for insight, text, and widget tiles; widget tiles require the dashboard-widgets feature flag on the project.",
+ "category": "Dashboards",
+ "feature": "dashboards",
+ "summary": "Transfer dashboard tile",
+ "title": "Transfer dashboard tile",
+ "required_scopes": ["dashboard:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"dashboard-update": {
- "description": "Update an existing dashboard by ID. Can update name, description, pinned status, tags, filters, and restriction level. To resize or move tiles, pass `tiles` with each tile's `id` from dashboard-get and a `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type, insight tiles included. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and height for its content and importance. Width can be any whole number from 1 to 12, subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's whole layout, so send a complete box, not just the value you want to change. Boxes are stored as sent and overlaps are not resolved, so plan the whole grid and send every tile you move in one request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use dashboard-reorder-tiles only for a whole-dashboard repack where every tile should use the same size. The same `tiles` array also updates a widget tile's own settings: add a nested `widget.id` from dashboard-get plus the fields to change (`config`, `name`, `description`). That is the same PATCH path the UI uses, but prefer dashboard-widgets-batch-update, which takes just a tile_id per widget. To add new widget tiles to this dashboard, use dashboard-widgets-batch-add instead. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.",
+ "description": "Resize, reposition, or update dashboard tiles. It can also update the dashboard name, description, pinned status, tags, filters, and restriction level. After you create or add insight tiles, call dashboard-get to get their tile IDs, then pass `tiles` with each tile's `id` and a `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type, including insight tiles. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and height for its content and importance. Width can be any whole number from 1 to 12, subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's whole layout, so send a complete box, not just the value you want to change. Boxes are stored as sent and overlaps are not resolved, so plan the whole grid and send every tile you move in one request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use dashboard-reorder-tiles only to repack the whole dashboard with preserved or uniform tile sizes. The same `tiles` array also updates a widget tile's own settings: add a nested `widget.id` from dashboard-get plus the fields to change (`config`, `name`, `description`). That is the same PATCH path the UI uses, but prefer dashboard-widgets-batch-update, which takes just a tile_id per widget. To add new widget tiles to this dashboard, use dashboard-widgets-batch-add instead. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.",
"category": "Dashboards",
"feature": "dashboards",
"summary": "Update dashboard",
@@ -3139,20 +3153,6 @@
"readOnlyHint": true
}
},
- "dashboards-move-tile-partial-update": {
- "description": "Move a tile from the source dashboard (path ID) to another dashboard. Provide to_dashboard (destination dashboard ID) and tile.id (tile ID from dashboard-get). Works for insight, text, and widget tiles; widget tiles require the dashboard-widgets feature flag on the project.",
- "category": "Dashboards",
- "feature": "dashboards",
- "summary": "Move dashboard tile",
- "title": "Move dashboard tile",
- "required_scopes": ["dashboard:write"],
- "annotations": {
- "destructiveHint": false,
- "idempotentHint": true,
- "openWorldHint": true,
- "readOnlyHint": false
- }
- },
"data-catalog-certification-certify-execute": {
"description": "Step 2 of 2 for certify source. Verifies the confirmation_hash from -prepare and the literal \"confirm\" string typed by the user, then performs the action. ONLY call this after the user has explicitly typed \"confirm\" in chat. Original action: Mark a table or view as certified (prefer this source), addressed by the certification id returned by data-catalog-certification-propose — create the proposal first if none exists. Requires human typed confirmation.",
"category": "Data catalog",
diff --git a/services/mcp/scripts/generate-tools.ts b/services/mcp/scripts/generate-tools.ts
index ecab6a9dd342..b6450fd5e2bb 100644
--- a/services/mcp/scripts/generate-tools.ts
+++ b/services/mcp/scripts/generate-tools.ts
@@ -772,9 +772,8 @@ function composeToolSchema(
if (sourceImport) {
let expr = `${sourceImport}.shape['${paramName}']`
if (override.required) {
- // PATCH body fields are `.optional()` in the Orval shape; unwrap so the
- // tool schema requires the field, matching the backend serializer.
- expr += '.unwrap()'
+ // Keep the Orval field description when requiring a PATCH body field.
+ expr += '.nonoptional()'
optionalParamNames.delete(paramName)
}
if (override.default !== undefined) {
diff --git a/services/mcp/src/lib/instructions.ts b/services/mcp/src/lib/instructions.ts
index 34f095ecd371..2674027d1586 100644
--- a/services/mcp/src/lib/instructions.ts
+++ b/services/mcp/src/lib/instructions.ts
@@ -233,6 +233,7 @@ export class ToolDomainExtractor {
'show',
'start',
'test',
+ 'transfer',
'unarchive',
'unfreeze',
])
diff --git a/services/mcp/src/tools/generated/ai_observability.ts b/services/mcp/src/tools/generated/ai_observability.ts
index 425c92b3e9d9..2352eaa59074 100644
--- a/services/mcp/src/tools/generated/ai_observability.ts
+++ b/services/mcp/src/tools/generated/ai_observability.ts
@@ -1564,7 +1564,7 @@ const LlmaPromptUpdateSchema = () => {
const LlmPromptsNamePartialUpdateParams = orvalSchemas.LlmPromptsNamePartialUpdateParams()
return LlmPromptsNamePartialUpdateParams.omit({ project_id: true })
.extend(LlmPromptsNamePartialUpdateBody.shape)
- .extend({ base_version: LlmPromptsNamePartialUpdateBody.shape['base_version'].unwrap() })
+ .extend({ base_version: LlmPromptsNamePartialUpdateBody.shape['base_version'].nonoptional() })
}
const llmaPromptUpdate = (): ToolBase<ReturnType<typeof LlmaPromptUpdateSchema>, Schemas.LLMPrompt> => ({
diff --git a/services/mcp/src/tools/generated/canvas.ts b/services/mcp/src/tools/generated/canvas.ts
index d73d76cc3c03..4137161ecd9c 100644
--- a/services/mcp/src/tools/generated/canvas.ts
+++ b/services/mcp/src/tools/generated/canvas.ts
@@ -284,7 +284,7 @@ const CanvasLayoutPublishSchema = () => {
'ID of the grid canvas whose layout to publish.'
),
expected_current_version_id: CanvasesLayoutPublishCreateBody.shape['expected_current_version_id']
- .unwrap()
+ .nonoptional()
.describe(
'The `current_version_id` this document was built on, from canvas-layout-get (null only for a grid canvas that has never published a layout). A whole document replaces the head, so without the guard a layout the user changed after you read it is silently discarded.'
),
@@ -364,7 +364,7 @@ const CanvasMoveSchema = () => {
.extend({
id: CanvasesPartialUpdateParams.shape['id'].describe('ID of the canvas to move.'),
channel_id: CanvasesPartialUpdateBody.shape['channel_id']
- .unwrap()
+ .nonoptional()
.describe('ID of the visible destination space.'),
})
}
diff --git a/services/mcp/src/tools/generated/customer_analytics.ts b/services/mcp/src/tools/generated/customer_analytics.ts
index defe0cd7b4d9..7b905d2913cd 100644
--- a/services/mcp/src/tools/generated/customer_analytics.ts
+++ b/services/mcp/src/tools/generated/customer_analytics.ts
@@ -1832,7 +1832,7 @@ const FeatureRequestsPartialUpdateSchema = () => {
const FeatureRequestsPartialUpdateParams = orvalSchemas.FeatureRequestsPartialUpdateParams()
return FeatureRequestsPartialUpdateParams.omit({ project_id: true })
.extend(FeatureRequestsPartialUpdateBody.shape)
- .extend({ expected_version: FeatureRequestsPartialUpdateBody.shape['expected_version'].unwrap() })
+ .extend({ expected_version: FeatureRequestsPartialUpdateBody.shape['expected_version'].nonoptional() })
}
const featureRequestsPartialUpdate = (): ToolBase<
diff --git a/services/mcp/src/tools/generated/dashboards.ts b/services/mcp/src/tools/generated/dashboards.ts
index 3c4fd77811be..c1ba9fcd224f 100644
--- a/services/mcp/src/tools/generated/dashboards.ts
+++ b/services/mcp/src/tools/generated/dashboards.ts
@@ -511,6 +511,42 @@ const dashboardTileCopy = (): ToolBase<
},
})
+const DashboardTransferTileSchema = () => {
+ const DashboardsMoveTilePartialUpdateBody = orvalSchemas.DashboardsMoveTilePartialUpdateBody()
+ const DashboardsMoveTilePartialUpdateParams = orvalSchemas.DashboardsMoveTilePartialUpdateParams()
+ return DashboardsMoveTilePartialUpdateParams.omit({ project_id: true })
+ .extend(DashboardsMoveTilePartialUpdateBody.shape)
+ .extend({
+ id: z.preprocess(castStringToInt, DashboardsMoveTilePartialUpdateParams.shape['id']),
+ tile: DashboardsMoveTilePartialUpdateBody.shape['tile'].nonoptional(),
+ to_dashboard: DashboardsMoveTilePartialUpdateBody.shape['to_dashboard'].nonoptional(),
+ })
+}
+
+const dashboardTransferTile = (): ToolBase<
+ ReturnType<typeof DashboardTransferTileSchema>,
+ WithPostHogUrl<Schemas.Dashboard>
+> => ({
+ name: 'dashboard-transfer-tile',
+ schema: DashboardTransferTileSchema(),
+ handler: async (context: Context, params: z.infer<ReturnType<typeof DashboardTransferTileSchema>>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const body: Record<string, unknown> = {}
+ if (params.to_dashboard !== undefined) {
+ body['to_dashboard'] = params.to_dashboard
+ }
+ if (params.tile !== undefined) {
+ body['tile'] = params.tile
+ }
+ const result = await context.api.request<Schemas.Dashboard>({
+ method: 'PATCH',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/dashboards/${encodeURIComponent(String(params.id))}/move_tile/`,
+ body,
+ })
+ return await withPostHogUrl(context, result, `/dashboard/${result.id}`)
+ },
+})
+
const DashboardUpdateSchema = () => {
const DashboardsPartialUpdateBody = orvalSchemas.DashboardsPartialUpdateBody()
const DashboardsPartialUpdateParams = orvalSchemas.DashboardsPartialUpdateParams()
@@ -836,38 +872,6 @@ const dashboardsGetAll = (): ToolBase<
},
})
-const DashboardsMoveTilePartialUpdateSchema = () => {
- const DashboardsMoveTilePartialUpdateBody = orvalSchemas.DashboardsMoveTilePartialUpdateBody()
- const DashboardsMoveTilePartialUpdateParams = orvalSchemas.DashboardsMoveTilePartialUpdateParams()
- return DashboardsMoveTilePartialUpdateParams.omit({ project_id: true })
- .extend(DashboardsMoveTilePartialUpdateBody.shape)
- .extend({ id: z.preprocess(castStringToInt, DashboardsMoveTilePartialUpdateParams.shape['id']) })
-}
-
-const dashboardsMoveTilePartialUpdate = (): ToolBase<
- ReturnType<typeof DashboardsMoveTilePartialUpdateSchema>,
- WithPostHogUrl<Schemas.Dashboard>
-> => ({
- name: 'dashboards-move-tile-partial-update',
- schema: DashboardsMoveTilePartialUpdateSchema(),
- handler: async (context: Context, params: z.infer<ReturnType<typeof DashboardsMoveTilePartialUpdateSchema>>) => {
- const projectId = await context.stateManager.getProjectId()
- const body: Record<string, unknown> = {}
- if (params.to_dashboard !== undefined) {
- body['to_dashboard'] = params.to_dashboard
- }
- if (params.tile !== undefined) {
- body['tile'] = params.tile
- }
- const result = await context.api.request<Schemas.Dashboard>({
- method: 'PATCH',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/dashboards/${encodeURIComponent(String(params.id))}/move_tile/`,
- body,
- })
- return await withPostHogUrl(context, result, `/dashboard/${result.id}`)
- },
-})
-
export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
'dashboard-create': dashboardCreate,
'dashboard-create-tile': dashboardCreateTile,
@@ -879,6 +883,7 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
'dashboard-templates-list': dashboardTemplatesList,
'dashboard-templates-retrieve': dashboardTemplatesRetrieve,
'dashboard-tile-copy': dashboardTileCopy,
+ 'dashboard-transfer-tile': dashboardTransferTile,
'dashboard-update': dashboardUpdate,
'dashboard-update-text-tile': dashboardUpdateTextTile,
'dashboard-widget-catalog-list': dashboardWidgetCatalogList,
@@ -886,5 +891,4 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
'dashboard-widgets-batch-update': dashboardWidgetsBatchUpdate,
'dashboard-widgets-run': dashboardWidgetsRun,
'dashboards-get-all': dashboardsGetAll,
- 'dashboards-move-tile-partial-update': dashboardsMoveTilePartialUpdate,
}
diff --git a/services/mcp/src/tools/generated/data_quality.ts b/services/mcp/src/tools/generated/data_quality.ts
index 06320414db0f..33e7410e52bf 100644
--- a/services/mcp/src/tools/generated/data_quality.ts
+++ b/services/mcp/src/tools/generated/data_quality.ts
@@ -134,8 +134,8 @@ const dataQualityCheckRun = (): ToolBase<
const DataQualityCheckScheduleSchema = () => {
const DataQualityChecksSchedulePartialUpdateBody = orvalSchemas.DataQualityChecksSchedulePartialUpdateBody()
return DataQualityChecksSchedulePartialUpdateBody.extend({
- subject_type: DataQualityChecksSchedulePartialUpdateBody.shape['subject_type'].unwrap(),
- subject_uuid: DataQualityChecksSchedulePartialUpdateBody.shape['subject_uuid'].unwrap(),
+ subject_type: DataQualityChecksSchedulePartialUpdateBody.shape['subject_type'].nonoptional(),
+ subject_uuid: DataQualityChecksSchedulePartialUpdateBody.shape['subject_uuid'].nonoptional(),
})
}
diff --git a/services/mcp/src/tools/generated/platform_features.ts b/services/mcp/src/tools/generated/platform_features.ts
index f169635e0fd8..4f84cb0933ac 100644
--- a/services/mcp/src/tools/generated/platform_features.ts
+++ b/services/mcp/src/tools/generated/platform_features.ts
@@ -637,7 +637,7 @@ const OrganizationEnforce2faSchema = () => {
.describe('Organization ID. If omitted, targets the active organization.')
.optional(),
enforce_2fa: PartialUpdateBody.shape['enforce_2fa']
- .unwrap()
+ .nonoptional()
.describe(
'Set to true to require every organization member to have 2FA enabled; false to lift the requirement. Applies org-wide and takes effect immediately.'
),
diff --git a/services/mcp/src/tools/generated/tasks.ts b/services/mcp/src/tools/generated/tasks.ts
index f2eb5f6d941e..93cf9d0035a4 100644
--- a/services/mcp/src/tools/generated/tasks.ts
+++ b/services/mcp/src/tools/generated/tasks.ts
@@ -621,7 +621,7 @@ const TasksCreateSchema = () => {
runtime: true,
}).extend({
description: TasksCreateBody.shape['description']
- .unwrap()
+ .nonoptional()
.describe(
'The task for the agent to carry out, written as a direct prompt (e.g. "Investigate the spike in $exception events on the checkout page and open a PR with a fix"). Passed verbatim to the agent as its instructions, so be specific.'
),
diff --git a/services/mcp/tests/integration/feature-routing.test.ts b/services/mcp/tests/integration/feature-routing.test.ts
index 4d3a4e61fb83..151b37790af1 100644
--- a/services/mcp/tests/integration/feature-routing.test.ts
+++ b/services/mcp/tests/integration/feature-routing.test.ts
@@ -48,6 +48,7 @@ describe('Feature Routing Integration', () => {
'dashboard-update',
'dashboard-delete',
'dashboard-reorder-tiles',
+ 'dashboard-transfer-tile',
],
},
{
diff --git a/services/mcp/tests/tools/dashboards.integration.test.ts b/services/mcp/tests/tools/dashboards.integration.test.ts
index 7fd8bbc92388..f220a9467351 100644
--- a/services/mcp/tests/tools/dashboards.integration.test.ts
+++ b/services/mcp/tests/tools/dashboards.integration.test.ts
@@ -122,6 +122,18 @@ describe('Dashboards', { concurrent: false }, () => {
})
createdResources.insights.push(insight.id)
+ const otherInsight = await context.api.request<{ id: number }>({
+ method: 'POST',
+ path: `/api/projects/${projectId}/insights/`,
+ body: {
+ name: generateUniqueKey('Other Layout Insight'),
+ query: SAMPLE_HOGQL_QUERIES.topEvents,
+ saved: true,
+ dashboards: [createdDashboard.id],
+ },
+ })
+ createdResources.insights.push(otherInsight.id)
+
const dashboardResult = await getTool.handler(context, { id: createdDashboard.id })
const dashboard = parseToolResponse(dashboardResult)
const tile = dashboard.tiles.find((item: { insight?: { id: number } }) => item.insight?.id === insight.id)
@@ -140,6 +152,11 @@ describe('Dashboards', { concurrent: false }, () => {
)
expect(updatedTile?.layouts).toEqual(layouts)
+ expect(
+ updatedDashboard.tiles.some(
+ (item: { insight?: { id: number } }) => item.insight?.id === otherInsight.id
+ )
+ ).toBe(true)
})
})
@@ -484,6 +501,13 @@ describe('Dashboards', { concurrent: false }, () => {
expect(reorderResponse.id).toBe(dashboard.id)
expect(reorderResponse._posthogUrl).toContain('/dashboard/')
+ const omittedTile = reorderResponse.tiles.find((tile: { id: number }) => tile.id === tileIds[0])
+ await reorderTiles.handler(context, { id: dashboard.id, tile_order: [tileIds[1]] })
+ const afterPartialReorder = parseToolResponse(await getOneDashboard.handler(context, { id: dashboard.id }))
+ expect(afterPartialReorder.tiles.find((tile: { id: number }) => tile.id === tileIds[0])?.layouts).toEqual(
+ omittedTile?.layouts
+ )
+
// Verify insight2 is still on dashboard2 after reordering dashboard1
const dashboard2WithTiles = parseToolResponse(await getOneDashboard.handler(context, { id: dashboard2.id }))
const dashboard2InsightIds = dashboard2WithTiles.tiles
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboards-move-tile-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-transfer-tile.json
similarity index 93%
rename from services/mcp/tests/unit/__snapshots__/tool-schemas/dashboards-move-tile-partial-update.json
rename to services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-transfer-tile.json
index 090dfe8d18e3..953ea1aa455c 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboards-move-tile-partial-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-transfer-tile.json
@@ -21,6 +21,6 @@
"type": "number"
}
},
- "required": ["id"],
+ "required": ["id", "to_dashboard", "tile"],
"type": "object"
}
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-prompt-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-prompt-update.json
index 73c04c8f30b9..8a9ec5acad2e 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-prompt-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-prompt-update.json
@@ -2,6 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"base_version": {
+ "description": "Latest version you are editing from. Used for optimistic concurrency checks.",
"minimum": 1,
"type": "number"
},
diff --git a/services/mcp/tests/unit/dashboard-update-schema.test.ts b/services/mcp/tests/unit/dashboard-update-schema.test.ts
index 75d8e46a627b..b1371ff43df3 100644
--- a/services/mcp/tests/unit/dashboard-update-schema.test.ts
+++ b/services/mcp/tests/unit/dashboard-update-schema.test.ts
@@ -3,6 +3,7 @@ import { z } from 'zod'
import { DashboardsPartialUpdateBody } from '@/generated/dashboards/api'
import { GENERATED_TOOLS } from '@/tools/generated/dashboards'
+import { getToolDefinitions } from '@/tools/toolDefinitions'
function getSchemaShape(schema: z.ZodTypeAny): Record<string, z.ZodTypeAny> {
if ('shape' in schema && schema.shape && typeof schema.shape === 'object') {
@@ -58,3 +59,28 @@ describe('dashboard-update schema', () => {
expect(result.success).toBe(false)
})
})
+
+describe('dashboard layout tool descriptions', () => {
+ it.each([
+ ['dashboard-update', /Resize, reposition, or update dashboard tiles/],
+ ['dashboard-reorder-tiles', /To repack the whole dashboard, include every tile ID/],
+ ['dashboard-transfer-tile', /source dashboard to another dashboard/],
+ ])('distinguishes %s from other layout tools', (name, expectedDescription) => {
+ expect(getToolDefinitions()[name]?.description).toMatch(expectedDescription)
+ })
+})
+
+describe('dashboard-transfer-tile schema', () => {
+ const tool = GENERATED_TOOLS['dashboard-transfer-tile']!()
+
+ it.each([
+ ['tile', { id: 1, to_dashboard: 2 }],
+ ['to_dashboard', { id: 1, tile: { id: 3 } }],
+ ])('rejects a request without %s', (_field, params) => {
+ expect(tool.schema.safeParse(params).success).toBe(false)
+ })
+
+ it('accepts a source dashboard, destination dashboard, and tile', () => {
+ expect(tool.schema.safeParse({ id: 1, to_dashboard: 2, tile: { id: 3 } }).success).toBe(true)
+ })
+})
diff --git a/services/mcp/tests/unit/generate-tools.test.ts b/services/mcp/tests/unit/generate-tools.test.ts
index e3486f114bda..2f52a3017d70 100644
--- a/services/mcp/tests/unit/generate-tools.test.ts
+++ b/services/mcp/tests/unit/generate-tools.test.ts
@@ -98,6 +98,32 @@ describe('composeToolSchema', () => {
expect(result.toolInputsImports).toEqual([])
})
+ it('requires a PATCH field without removing its Orval description', () => {
+ const config: ToolConfig = {
+ operation: 'things_partial_update',
+ enabled: true,
+ param_overrides: { destination: { required: true } },
+ }
+ const resolved = makeResolved({
+ method: 'PATCH',
+ operation: {
+ operationId: 'things_partial_update',
+ parameters: [],
+ requestBody: {
+ content: {
+ 'application/json': {
+ schema: { properties: { destination: { type: 'integer' } } },
+ },
+ },
+ },
+ },
+ })
+
+ const result = composeToolSchema(config, resolved, makeSpec(), stubGetQuerySchema)
+
+ expect(result.schemaExpr).toContain("ThingsPartialUpdateBody.shape['destination'].nonoptional()")
+ })
+
it('collects toolInputsImports from param_overrides with input_schema', () => {
const config: ToolConfig = {
operation: 'things_create',
diff --git a/services/mcp/tests/unit/instructions.test.ts b/services/mcp/tests/unit/instructions.test.ts
index 5323eadab697..0be33c20cf5d 100644
--- a/services/mcp/tests/unit/instructions.test.ts
+++ b/services/mcp/tests/unit/instructions.test.ts
@@ -148,6 +148,7 @@ describe('buildToolDomainsBlock', () => {
'show',
'start',
'test',
+ 'transfer',
'unarchive',
'unfreeze',
]
diff --git a/services/mcp/tests/unit/tool-filtering.test.ts b/services/mcp/tests/unit/tool-filtering.test.ts
index 2dc2d8ac3564..692cfaa4eb28 100644
--- a/services/mcp/tests/unit/tool-filtering.test.ts
+++ b/services/mcp/tests/unit/tool-filtering.test.ts
@@ -324,6 +324,7 @@ describe('Tool Filtering - API Scopes', () => {
expect(toolNames).toContain('dashboard-get')
expect(toolNames).toContain('dashboards-get-all')
expect(toolNames).toContain('dashboard-reorder-tiles')
+ expect(toolNames).toContain('dashboard-transfer-tile')
expect(toolNames).not.toContain('create-feature-flag')
expect(toolNames).not.toContain('organizations-list')