You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
search_events tools fail on open-ended 'since X' time ranges #2272
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
The caller asks for something like "error or fatal logs since <ISO timestamp>, grouped by message with count and latest timestamp".
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).
@sentry/api's applyTimeParams rejects it client-side: ApiValidationError: Both start and end parameters must be provided together for absolute time ranges.
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.
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.
Activity
linear-code commentedon Nov 14, 2026
MCP-1230
sentry-junior commentedon Nov 14, 2026
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-coresuite passes locally. A PR isn't open yet: the automated PR creation was blocked because it would also have requested a review.