Skip to content

fix(mcp): shorten trace_top_time_consuming_operations to trace_top_time_consuming_ops - #3698

Merged
kodiakhq[bot] merged 3 commits into
mainfrom
brandon/brandon-mcp-tool-name-shrink
Nov 17, 2026
Merged

kodiakhq[bot] merged 3 commits into
mainfrom
brandon/brandon-mcp-tool-name-shrink

Conversation

@brandon-pereira

Copy link
Copy Markdown
Member

Summary

Renames the MCP tool clickstack_trace_top_time_consuming_operations (46 chars) to clickstack_trace_top_time_consuming_ops (39 chars).

It was our longest tool name. Some MCP clients cap tool name length (and many prefix the server name on top), so the long name could be truncated or rejected. The shorter name keeps it inside the safe range for most clients.

Updates the registration, error message, cross-references in other tool descriptions, integration tests, and MCP.md. Historical CHANGELOG entries are left as-is.

Breaking for callers using the old name — agents discover tools via tools/list, so most clients pick up the new name automatically.

How to reproduce

Starting point: yarn dev, connect an MCP client to the API's /mcp endpoint.

On main:

  1. List tools; clickstack_trace_top_time_consuming_operations is present.

On this branch:

  1. List tools; clickstack_trace_top_time_consuming_ops is present and behaves the same.

How to test on Vercel preview

N/A — non-UI change.

@brandon-pereira
brandon-pereira requested a review from a team as a code owner November 17, 2026 19:54
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Nov 17, 2026 9:03pm UTC
hyperdx-storybook Ready Ready Preview Nov 17, 2026 9:03pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2abe867

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/api Patch
@hyperdx/app Patch
@hyperdx/otel-collector Patch

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

@github-actions github-actions Bot added the review/tier-2 Low risk — AI review + quick human skim label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🔵 Tier 2 — Low Risk

Small, isolated change with no API route or data model modifications.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns.
SLA: Resolve within 4 business hours.

Stats
  • Production files changed: 4
  • Production lines changed: 12 (+ 39 in test files, excluded from tier calculation)
  • Branch: brandon/brandon-mcp-tool-name-shrink
  • Author: brandon-pereira

To override this classification, remove the review/tier-2 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 critical or 🟠 major in code this PR adds or changes: fix before asking for review.
  • 🔵 minor in code this PR changes: your call. Fix if small, otherwise reply.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    severity. Reply with one sentence; if it is critical, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

1 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 1 minor

None could be anchored to changed lines; they are listed below.

Findings outside the changed lines

1 minor
  • 🔵 packages/api/src/mcp/__tests__/trace.int.test.ts:217 — Tool-name length check for every tool sits in the DB-backed trace integration suite → Move this test into packages/api/src/mcp/__tests__/toolAnnotations.test.ts, which already holds the checks that apply to every tool. That suite builds the client with a dummy context and needs no Mongo or ClickHouse, so the check would run in the fast unit job instead of only in the trace int job, which creates a connection and two sources for each test. Also add expect(tools.length).toBeGreaterThan(0) as that file does, because a tool list that comes back empty passes toEqual([]) without checking anything.

Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides.

@github-actions

Copy link
Copy Markdown
Contributor

Duplicate code analysis

1 new clone introduced by this PR.

  • packages/api/src/mcp/tools/trace/breakdown.ts:73-89 ↔ packages/api/src/mcp/tools/trace/waterfall.ts:339-354 — 17 lines

If one of these duplicates a helper that already exists, import it instead
of redefining it. If the duplication is deliberate, ignore this comment —
the check is advisory and never fails the build.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 108 in total (1.17%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

Scope: mechanical rename of the MCP tool clickstack_trace_top_time_consuming_operations → clickstack_trace_top_time_consuming_ops, plus a new test asserting all tool names stay ≤40 chars. Base bfb5c834.

✅ No critical issues found.

Verification performed against the diff:

  • The rename is complete. A repo-wide search for the old identifier finds remaining matches only in historical CHANGELOG.md / packages/api/CHANGELOG.md entries and the new changeset — all intentional. The registration, the kind= error message in breakdown.ts, the cross-references in serviceHealth/index.ts and waterfall.ts, BUILDER_TOOLS_LIST, the integration tests, and the MCP.md table are all updated consistently.
  • The new should keep every tool name within 40 characters test passes: the renamed tool (39 chars) is now the longest registered name, and every other clickstack_* tool is shorter, so the assertion holds without flagging unrelated tools.
🔵 P3 nitpicks (1)
  • packages/api/src/mcp/__tests__/trace.int.test.ts:234 — the test comment notes clients often cap length after prefixing the server name, but the assertion checks only the raw 40-char tool name, so a client-prefixed name can still exceed the cap the rename was meant to avoid.
    • Fix: either note in the comment that the 40-char budget is the bare tool name only, or lower the asserted limit to leave headroom for a server-name prefix.

Reviewers (4): correctness, testing, project-standards, previous-comments.

Testing gaps: none substantive — existing trace-tool integration tests were updated in place and a tool-name-length guard was added; the jscpd "new clone" between breakdown.ts and waterfall.ts is a pre-existing duplication whose line numbers shifted, not logic introduced by this rename.

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

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 467 passed • 1 skipped • 1082s

Status Count
✅ Passed 467
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

@kodiakhq
kodiakhq Bot merged commit 6256667 into main Nov 17, 2026
28 checks passed
@kodiakhq
kodiakhq Bot deleted the brandon/brandon-mcp-tool-name-shrink branch November 17, 2026 21:06

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 2abe8675 Deployed Nov 17, 2026 by vercel[bot]
Preview – hyperdx-storybook — 2abe8675 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge review/tier-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants