fix(mcp): improve alias descriptions and examples for readable chart legends#2418
Conversation
…egends The MCP tool schemas described the alias field as just 'Display label for this series' and all example tiles in mcpTilesParam omitted aliases entirely. This caused LLMs to skip aliases, resulting in chart legends showing raw ClickHouse expressions like count() or quantile(0.95)(Duration) instead of human-readable labels. Changes: - Add aliases to every example tile in mcpTilesParam (except heatmap) - Expand alias field descriptions in both dashboard and query schemas to explain what aliases are used for and what happens without them
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 3e01388 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
|
86cf765 to
da3840e
Compare
E2E Test Results✅ All tests passed • 194 passed • 3 skipped • 1327s
Tests ran across 4 shards in parallel. |
Deep Review✅ No critical issues found. This is a description-only change: expanded 🔵 P3 nitpicks (1)
Reviewers (5): correctness, testing, maintainability, project-standards, kieran-typescript. Testing gaps: No automated test asserts that the example tiles embedded in |
Fixes HDX-4453
Problem
When the MCP generates dashboard tiles or query charts, series legends often show raw ClickHouse expressions like
count()orquantile(0.95)(Duration)instead of human-readable labels. This happens because:aliasfield description in the JSON schema was minimal ("Display label for this series") with no urgency to include itmcpTilesParamomitted aliases entirely — LLMs copy these patternsChanges
mcpTilesParam(except heatmap which doesn't use aliases):"Errors","Requests","Avg Duration","P95 Latency"aliasfield description in both dashboard and query schemas to explain what aliases are used for (legends, table headers, CSV exports, onClick templates) and what happens without them (raw ClickHouse expressions in the UI)These are description-only changes to the Zod schemas — no runtime behavior changes. The JSON schema
descriptionis what every MCP client sees on every tool call, making this the highest-impact place to guide LLMs toward always including aliases.