Skip to content

Commit a49447d

Browse files
alex-fedotyevclaude
andcommitted
feat(mcp): expose table tile alternateRowBackground in dashboard authoring schema
Adds alternateRowBackground to the clickstack_save_dashboard builder table tile schema and a short prompt guidance line, with a handler round-trip test asserting the field persists. Depends on the external API PR it is stacked on, since the MCP save path validates and converts through the external dashboard schema. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5c9b9e9 commit a49447d

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@hyperdx/api": patch
3+
---
4+
5+
feat(mcp): expose table tile alternate row background in the dashboard authoring tool
6+
7+
The clickstack_save_dashboard MCP tool now accepts alternateRowBackground on builder table tiles, so AI-authored dashboards can turn on zebra striping. Defaults to false.

packages/api/src/mcp/__tests__/dashboards/saveDashboard.int.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ describe('MCP Dashboard Tools - clickstack_save_dashboard', () => {
191191
select: [{ aggFn: 'count' }],
192192
groupBy: 'SpanName',
193193
groupByColumnsOnLeft: true,
194+
alternateRowBackground: true,
194195
},
195196
},
196197
{
@@ -251,6 +252,7 @@ describe('MCP Dashboard Tools - clickstack_save_dashboard', () => {
251252
);
252253
expect(tableTile).toBeDefined();
253254
expect(tableTile.config.groupByColumnsOnLeft).toBe(true);
255+
expect(tableTile.config.alternateRowBackground).toBe(true);
254256
});
255257

256258
it('should create a dashboard with a raw SQL tile', async () => {

packages/api/src/mcp/prompts/dashboards/content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Apply these before calling clickstack_save_dashboard. Each rule is enforced by t
9696
9797
3. GROUP BY HAS NO ALIAS HOOK. The chart config's groupBy is a single expression string and the renderer uses it verbatim as the column header (tables) and as the raw column name everywhere else (CSV export, tooltips, orderBy references, onClick template references). Grouping a table by SpanAttributes['http.route'] produces a column header that reads literally as arrayElement(SpanAttributes, 'http.route'). When a top-level column carries the same semantic, prefer it: SpanName for operation, ServiceName for service, SeverityText for log severity. When the dimension exists only as a Map attribute and the column header matters, drop to a raw SQL tile (configType: "sql") and write the column with AS alias. Line, stacked_bar, and pie tiles legend by the value not the column name, so the issue is invisible on the chart itself but still bites CSV export and onClick template references.
9898
99-
4. INVENTORY-STYLE TABLES PUT THE GROUP BY ON THE LEFT. Set groupByColumnsOnLeft: true on tables that read like a list of things (one row per service, per endpoint, per tenant).
99+
4. INVENTORY-STYLE TABLES PUT THE GROUP BY ON THE LEFT. Set groupByColumnsOnLeft: true on tables that read like a list of things (one row per service, per endpoint, per tenant). For wide tables that are hard to scan, set alternateRowBackground: true to zebra-stripe the rows (default false).
100100
101101
5. RED COLUMNS FOR SERVICE / ENDPOINT TABLES. Request rate (count), Error rate (count with where: "StatusCode:STATUS_CODE_ERROR"), Duration (quantile P95 on the Duration column). Three columns, all aliased.
102102

packages/api/src/mcp/tools/dashboards/schemas.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,13 @@ const mcpTableTileSchema = mcpTileLayoutSchema.extend({
694694
'Render Group By columns on the left side of the table, before the series columns. ' +
695695
'Default false (Group By columns on the right).',
696696
),
697+
alternateRowBackground: z
698+
.boolean()
699+
.optional()
700+
.describe(
701+
'Zebra-stripe the table by tinting alternating rows, which aids scanning on wide tables. ' +
702+
'Default false.',
703+
),
697704
numberFormat: mcpNumberFormatSchema
698705
.optional()
699706
.describe(tileLevelNumberFormatDescription),

0 commit comments

Comments
 (0)