Skip to content

[jaegermcp] Improve MCP tool descriptions#8314

Merged
jkowall merged 4 commits into
jaegertracing:mainfrom
lopster568:jaegermcp-improve-tool-descriptions
Apr 15, 2026
Merged

[jaegermcp] Improve MCP tool descriptions#8314
jkowall merged 4 commits into
jaegertracing:mainfrom
lopster568:jaegermcp-improve-tool-descriptions

Conversation

@lopster568
Copy link
Copy Markdown
Contributor

Which problem is this PR solving?

Follow-up to feedback on #8311: tool descriptions should be self-sufficient so agents can make informed decisions from tool metadata alone, without relying on external prompts or instructions.

The current descriptions are minimal one-liners that don't clarify what each tool returns vs. what it omits. An agent reading the current descriptions cannot distinguish a lightweight call (topology) from a verbose one (span details), or know that error results may be truncated.

Description of the changes

Improved descriptions for all 8 MCP tools. Each description now states:

  • What the tool does
  • What distinguishes its output (lightweight vs verbose, what data is included vs omitted)
  • Runtime behavior the schema cannot express (truncation, time format hints)

No workflow ordering or cross-tool sequencing was added. The input/output schemas already encode parameter dependencies (e.g. service_name required in search_traces).

1 file changed, string-only modifications. No logic changes.

How was this change tested?

  • go test ./cmd/jaeger/internal/extension/jaegermcp/... - all passing
  • make lint - 0 issues
  • make fmt - clean
  • Descriptions are strings with no runtime effect; existing tests validate tool behavior unchanged.

Checklist

AI Usage in this PR (choose one)

  • Light: AI provided minor assistance (formatting, simple suggestions)

Clarify what each tool returns vs. what it omits, so agents
can make informed decisions from tool metadata alone:
- search_traces: lightweight summaries without spans or attributes
- get_span_details: verbose OTLP output per span
- get_trace_errors: truncation behavior via total_error_count
- get_trace_topology: does not include attributes, events, or logs
- get_critical_path: self_time_us identifies the bottleneck

Signed-off-by: Roshan Singh <rosh.s568@gmail.com>
Signed-off-by: Roshan <rosh.s568@gmail.com>
@lopster568 lopster568 requested a review from a team as a code owner April 8, 2026 04:56
Copilot AI review requested due to automatic review settings April 8, 2026 04:56
@dosubot dosubot Bot added the enhancement label Apr 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the human-readable MCP tool descriptions for the Jaeger MCP server so agents/clients can make better decisions using tool metadata alone (part of #7827, follow-up to #8311).

Changes:

  • Expanded the Description strings for the 8 registered MCP tools to clarify intent, output “weight”, and runtime behaviors (e.g., truncation, time formats).
  • Added more detailed explanations for topology and critical path tools to help agents choose appropriate calls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go
Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go Outdated
- OTLP spans have events, not logs. Fixed in topology description.
- self_time_us indicates where time is concentrated, not a definitive
  bottleneck label. Softened in critical path description.

Signed-off-by: Roshan Singh <rosh.s568@gmail.com>
Signed-off-by: Roshan <rosh.s568@gmail.com>
Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go Outdated
Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go Outdated
- Remove trailing period from get_span_names description
- Add 'etc.' to search_traces field list
- Remove time format hint from search_traces (parameter specs belong in schema)
- Remove 'OTLP' from get_span_details and get_trace_errors descriptions

Signed-off-by: Roshan Singh <roshansingh7890@gmail.com>
Signed-off-by: Roshan <rosh.s568@gmail.com>
Copilot AI review requested due to automatic review settings April 11, 2026 04:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go
Comment thread cmd/jaeger/internal/extension/jaegermcp/server.go
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.87%. Comparing base (a506790) to head (3db9f08).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8314   +/-   ##
=======================================
  Coverage   95.87%   95.87%           
=======================================
  Files         320      320           
  Lines       16873    16883   +10     
=======================================
+ Hits        16177    16187   +10     
  Misses        541      541           
  Partials      155      155           
Flag Coverage Δ
badger_direct 9.20% <ø> (ø)
badger_e2e 1.06% <ø> (ø)
cassandra-4.x-direct-manual 13.42% <ø> (ø)
cassandra-4.x-e2e-auto 1.05% <ø> (ø)
cassandra-4.x-e2e-manual 1.05% <ø> (ø)
cassandra-5.x-direct-manual 13.42% <ø> (ø)
cassandra-5.x-e2e-auto 1.05% <ø> (ø)
cassandra-5.x-e2e-manual 1.05% <ø> (ø)
clickhouse 1.18% <ø> (ø)
elasticsearch-6.x-direct 17.29% <ø> (ø)
elasticsearch-7.x-direct 17.32% <ø> (ø)
elasticsearch-8.x-direct 17.47% <ø> (ø)
elasticsearch-8.x-e2e 1.06% <ø> (ø)
elasticsearch-9.x-e2e 1.06% <ø> (ø)
grpc_direct 8.00% <ø> (ø)
grpc_e2e 1.06% <ø> (ø)
kafka-3.x-v2 1.06% <ø> (ø)
memory_v2 1.06% <ø> (ø)
opensearch-1.x-direct 17.36% <ø> (ø)
opensearch-2.x-direct 17.36% <ø> (ø)
opensearch-2.x-e2e 1.06% <ø> (ø)
opensearch-3.x-e2e 1.06% <ø> (ø)
query 1.06% <ø> (ø)
tailsampling-processor 0.53% <ø> (ø)
unittests 94.55% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lopster568 lopster568 requested a review from yurishkuro April 14, 2026 18:48
@yurishkuro yurishkuro added the changelog:experimental Change to an experimental part of the code label Apr 14, 2026
@yurishkuro yurishkuro enabled auto-merge April 14, 2026 23:28
@yurishkuro yurishkuro added this pull request to the merge queue Apr 14, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Apr 14, 2026
## Which problem is this PR solving?

- Part of #7827

Follow-up to feedback on #8311: tool descriptions should be
self-sufficient so agents can make informed decisions from tool metadata
alone, without relying on external prompts or instructions.

The current descriptions are minimal one-liners that don't clarify what
each tool returns vs. what it omits. An agent reading the current
descriptions cannot distinguish a lightweight call (topology) from a
verbose one (span details), or know that error results may be truncated.

## Description of the changes

Improved descriptions for all 8 MCP tools. Each description now states:
- What the tool does
- What distinguishes its output (lightweight vs verbose, what data is
included vs omitted)
- Runtime behavior the schema cannot express (truncation, time format
hints)

No workflow ordering or cross-tool sequencing was added. The
input/output schemas already encode parameter dependencies (e.g.
service_name required in search_traces).

**1 file changed, string-only modifications. No logic changes.**

## How was this change tested?

- `go test ./cmd/jaeger/internal/extension/jaegermcp/...` - all passing
- `make lint` - 0 issues
- `make fmt` - clean
- Descriptions are strings with no runtime effect; existing tests
validate tool behavior unchanged.

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/main/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully: `make lint test`

## AI Usage in this PR (choose one)
- [x] **Light**: AI provided minor assistance (formatting, simple
suggestions)

---------

Signed-off-by: Roshan Singh <rosh.s568@gmail.com>
Signed-off-by: Roshan <rosh.s568@gmail.com>
Signed-off-by: Roshan Singh <roshansingh7890@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 15, 2026
@jkowall jkowall added this pull request to the merge queue Apr 15, 2026
Merged via the queue into jaegertracing:main with commit ad7f546 Apr 15, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:experimental Change to an experimental part of the code enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants