feat(api/mcp): add heatmap tile schema for hyperdx_save_dashboard#2199
feat(api/mcp): add heatmap tile schema for hyperdx_save_dashboard#2199alex-fedotyev wants to merge 1 commit intomainfrom
Conversation
Adds a heatmap display type to the MCP mcpTilesParam schema so AI agents can author heatmap tiles via hyperdx_save_dashboard. New mcpHeatmapSelectItemSchema carries valueExpression, countExpression, alias, and heatmapScaleType, mirroring the heatmap fields persisted in DerivedColumnSchema. Adds a unit test file covering accept/reject cases for the heatmap schema and a few-shot example in the tiles description block. Drive-by cleanup: replaced en-dashes used as em-dashes in pre-existing describe() strings with regular punctuation to match the team's writing style. Follow-up to #2107 (heatmap chart type wired into editor and renderer). This PR adds the MCP-side schema only. End-to-end save/get of heatmap tiles also requires the external API conversion layer to land in a sister PR before AI agents can persist heatmap tiles via hyperdx_save_dashboard. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: b5d68f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
PR Review
✅ No critical bugs or security issues. Schema fields ( |
E2E Test Results✅ All tests passed • 159 passed • 3 skipped • 1191s
Tests ran across 4 shards in parallel. |
Summary
Adds a
heatmapdisplay type to the MCPmcpTilesParamschema so AI agentscan author heatmap tiles via
hyperdx_save_dashboard.The new
mcpHeatmapSelectItemSchemamirrors the heatmap fields persisted inDerivedColumnSchema(common-utils):aggFn: literal"heatmap"(not part ofAggregateFunctionSchema)valueExpression: required column to bucket on the Y axiscountExpression: optional normalization expressionalias: optional display labelheatmapScaleType: optional"log" | "linear"The new
mcpHeatmapTileSchemaaddsnumberFormatso AI agents can formatdurations/bytes on the value axis.
groupByis intentionally omitted becauseheatmap tiles don't group, and per-select
where/whereLanguageis omittedbecause heatmap doesn't filter per-item (filtering happens at the chart level).
Stacked on #2200
This PR is stacked on #2200 ([HDX-4120] external dashboards API heatmap support).
Without #2200, calls to
hyperdx_save_dashboardwith a heatmap tile wouldreturn a cryptic Zod validation error from the external-API discriminated
union. #2200 should merge first, then this PR rebases on main and an
integration round-trip test can be added in
dashboards.test.ts(extendingthe existing "create a dashboard with multiple tile types" pattern).
Marking this PR draft until #2200 lands.
What's in this PR
mcpHeatmapSelectItemSchemaandmcpHeatmapTileSchemainmcp/tools/dashboards/schemas.tsmcpTileSchemaz.union(...)mcpTilesParam.describe(...)blockmcp/tools/dashboards/__tests__/schemas.test.tscovering accept and reject casesWhat's NOT in this PR
mcpSqlTileSchema.config.displayTypeenum is intentionally untouched.dashboards.test.ts. Will be added once[HDX-4120] feat(api): support heatmap tiles in external dashboards API #2200 merges and this branch rebases on main.
Drive-by
The pre-existing en-dashes (used as em-dashes) in seven
describe()stringson this file were replaced with regular punctuation to match the team's
writing style. No semantic change.
Test plan
yarn lintcleanyarn tsc --noEmitcleanjest src/mcp/tools/dashboards/__tests__/schemas.test.ts(5/5 passing)prose-lint --stagedclean