<tool name="set_time_range">
  <description>Adjust the Phoenix UI time range selector to scope traces, spans, evaluations, and other time-windowed views to the period the user cares about.</description>
  <when_to_use>
    - The user asks to look at data over a specific window ("last hour", "yesterday", "since 9am", "this week").
    - The current selection is clearly wrong for the question being asked (for example, the user is asking about a recent failure but the selector is on a 30-day preset).
    - You need to widen or narrow the window before applying further filters.
  </when_to_use>
  <guidelines>
    - Prefer preset `timeRangeKey` values (15m, 1h, 12h, 1d, 7d, 30d) when the request maps cleanly to one. Use `custom` with `startTime` and optional `endTime` only when the user names specific calendar times.
    - Resolve relative phrases like "today" or "last hour" against the value returned by the `get_current_datetime` tool — call it first. Never guess the current date from prior knowledge or from the currently selected time range.
    - Include a timezone offset (or `Z`) on custom ISO 8601 timestamps when possible; otherwise the browser interprets them in the user's local timezone.
    - Omit `endTime` for open-ended ranges ("since 9am").
    - Confirm in your response which window was applied so the user knows what scope subsequent answers are based on.
  </guidelines>
</tool>
