Repository navigation
fix(mcp): tighten tool and input descriptions - #3396
brandon-pereira wants to merge 11 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 17d1449 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryThe PR shortens MCP descriptions, fills in missing input descriptions, and explains updates and side effects.
Reviews (11) · Last reviewed commit: "fix(mcp): clarify saved-search whereLang..." · Reviewed by Greptile |
E2E Test Results✅ All tests passed • 430 passed • 1 skipped • 1335s
Tests ran across 4 shards in parallel. |
🔴 Tier 4 — CriticalTouches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
PR Review✅ No issues found. |
Deep ReviewScope: ✅ No critical issues found. No P0/P1/P2 issues were confirmed. The structural (non-text) changes are contract-safe, and the highest-risk description claims were verified against the backing code:
🔵 P3 nitpicks (4)
Reviewers (5 returned): api-contract, previous-comments, kieran-typescript, maintainability, learnings-researcher. Testing gaps:
Coverage note: Synthesis was forced before 5 of the 10 dispatched reviewers returned — No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
…ls and test input descriptions
…s; share schema walker in tests
Summary
Claude Code truncates MCP tool descriptions longer than 2048 UTF-8 bytes. A tool-doc review also found inputs with no description, descriptions that repeat schema constraints (defaults, ranges, enum lists), ID fields that don't say where the ID comes from, and tools that don't describe their mutations or return values.
Nearly all changes are text only:
clickstack_event_deltas(3318 → 1796 bytes),trace_top_time_consuming_operations(2585 → 1436),trace_waterfall(2199 → 1244),table(2082 → 1578).save_sourcefields, dashboard tileconfig/containers/colorRules/backgroundChart, alert chart-levelwhereLanguage, and theevent_deltasbaseline fields.save_alert,save_webhook,save_saved_searchandpatch_dashboardnow describe how updates work and what side effects they have. For example,patch_dashboarddeletes the alerts on a tile when the tile's new config can't hold alerts.get_dashboard_tileandquery_tilenow describe what they return.percentnumber format multiplies by 100, andheatmapScaleTypesets the Y-axis scale.Non-text changes. Validation behavior doesn't change:
BackgroundChartSchema, andDashboardContainerSchema/DashboardContainerTabSchemaare added incommon-utils/src/types.ts, so the MCP tools use those schemas unchanged. Other consumers get the descriptions too.query/eventDeltasbuilds the target and baseline groups from a small factory so each group gets its own descriptions. Types and defaults are unchanged.Not done:
outputSchema, because tools return JSON as text content, notstructuredContent.$refdedupe pointers. These come from the scanner, not from missing descriptions.packages/api/src/mcp/__tests__/toolDescriptions.test.tsfails if any tool description or the server instructions are empty or go over 2048 bytes, or if any input property lacks a description (bare$refpointers excepted).How to reproduce
Starting point: local
yarn dev.On
main:yarn dev.npx @modelcontextprotocol/inspectorto the local MCP endpoint (seeMCP.md).initializeandtools/listresponses.clickstack_event_deltasand the trace tools have descriptions over 2048 bytes, and several inputs have no description.On this branch:
References
agent/mcp-tool-annotations