Skip to content

[Bug]: search_traces gives no truncation signal and silently clamps search_depth #9319

Description

@Lagmator22

What happened?

search_traces bounds its result by search_depth and reports neither the depth it used nor whether the result hit it.

Two things are invisible to the caller:

  1. A result that fills the depth looks identical to an exhaustive one. Ask for 10, get 10, and there is no way to tell whether the trace you needed was the eleventh.
  2. The requested depth is clamped to the server's MaxSearchResults with no notice. buildQuery does if searchDepth > h.maxResults { searchDepth = h.maxResults }. Ask for 500 on a default server and the search runs at 100.

The schema says the max is "controlled by server config", but the response never says what that turned out to be.

Expected behavior

The same signal the sibling tools already give:

search_traces is the entry point for most investigations and has nothing.

Storage applies the depth, so an exact match total is not available without a second query. What the handler can report honestly is the depth it actually used and whether the result filled it.

Additional context

This matters more than a normal missing field because it interacts with context budgeting. An agent that cannot tell a full page from a complete one either re-queries blindly or stops early on a partial view, and neither shows up as a tool error.

PR follows.

Jaeger backend version

main (26c5612)

SDK

Not applicable, this is in the MCP handler layer.

Pipeline

Not applicable.

Stogage backend

Any, the behavior is in the handler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions