Skip to content

search_events tools fail on open-ended 'since X' time ranges #2272

Open

Description

@sentry-junior

Pattern: search_events tools (search_logs, search_errors, search_spans, …) fail on open-ended "since X" time ranges with "The AI could not construct a valid query for this request."

Reports: 1 (user feedback, MCP server 0.42.0, search_logs)

What happens

  1. The caller asks for something like "error or fatal logs since <ISO timestamp>, grouped by message with count and latest timestamp".
  2. The embedded agent calls validateSearch with start and no end. The validateSearch tool schema allows that (end is optional in createValidateEventsSearchTool, packages/mcp-core/src/tools/support/search-events/utils.ts).
  3. @sentry/api's applyTimeParams rejects it client-side: ApiValidationError: Both start and end parameters must be provided together for absolute time ranges.
  4. The agent's output schema (searchEventsAgentOutputSchema.timeRange, agent.ts) also requires both start and end, so the agent can't return a "since X" range either. It ends with no output and the tool throws the error above.

Production logs for the report show that sequence: an ApiValidationError from the agent tool, then Embedded agent produced no output (No output generated.), then search_logs query failed with the error above. The agent's own tool-call arguments weren't sampled, so step 2 is inferred from the error string: in this agent, only validateSearch passes start/end to the API client.

This is the same gap #2261 fixed for search_issue_events.

Fix: a draft PR runs start-only ranges until now in both validateSearch and the executed search (linked below).

Not this issue: the same report also hit a mixed prose + filter query run verbatim (... from <ISO> to <ISO>, grouped by message with explicit fields/sort), which Sentry rejected with Unknown attribute on the date tokens. That one is covered by #2263.

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_7279479ddc694c929e1ac9b02c74dd96.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 14, 2026

    @linear-code
  2. sentry-junior commented on Nov 14, 2026

    @sentry-junior
    ContributorAuthor

    The fix and its regression tests are pushed to branch fix/search-events-open-ended-time-range (43964f6). Both tests fail without the fix and pass with it, and the full @sentry/mcp-core suite passes locally. A PR isn't open yet: the automated PR creation was blocked because it would also have requested a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MCPSentry MCP tools, transports, and documentationmcp-feedback-pattern

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions