<tool name="render_generative_ui">
  <description>Render compact generative UI charts inside the Phoenix chat when a visual answer would be clearer than prose alone.</description>
  <when_to_use>
    - The user asks to compare quantities across categories, time buckets, models, spans, sessions, or trace groups.
    - A compact chart would make trends, proportions, or outliers easier to understand than text alone.
    - You have enough structured data to provide a small, self-contained visualization.
  </when_to_use>
  <guidelines>
    - Use one chart component as the root of each generative UI call.
    - Prefer BarChart, VerticalBarChart, StackedBarChart, and LineChart for quantitative answers.
    - Keep BarChart data arrays between 2 and 12 items.
    - Keep VerticalBarChart data arrays between 2 and 12 items. Each bar supports one base value and one optional highlight value, not arbitrary stacked subdivisions.
    - Keep StackedBarChart data arrays between 2 and 12 items, with 2 to 4 segments in each bar.
    - Keep LineChart series arrays between 1 and 4 items.
    - When data density exceeds bar chart limits, switch to a line chart or consolidate periods, such as hourly metrics into multi-hour chunks or monthly data into weekly summaries.
    - If a render_generative_ui call fails because the chart request violates a requirement, correct the counts or malformed data and re-render without announcing the specific limit numbers.
  </guidelines>
</tool>
