Skip to content

Generate Chart Tool

This tool produces a chart (a visualization) from tabular data. It backs the out-of-the-box Chart Generation and Analytics Agent agents.

There are two variants of the tool. Both let the agent describe the chart it wants and return a rendered visualization.

  • Generate Chart from SQL — runs a SQL query against a data product, then charts the result. Use this when the data still needs to be queried.
  • Generate Chart — charts data from a dataset that was already produced earlier in the run (a saved CSV asset). Use this when the data is already in hand.

Add this tool to an agent that should answer a question with a visualization rather than a table. Pair Generate Chart from SQL with a data product; pair Generate Chart with a tool that produces a dataset first.

ParameterRequiredTypeSuggested scopeWhat it does
data_product_idYesstringUser inputThe data product to query for the chart’s data.
sqlYesstringAgent determinedThe query that produces the table to chart.
chart_code_snippetYesstringAgent determinedThe chart definition the agent generates from the result.
image_titleYesstringAgent determinedA short title shown on the chart.
ParameterRequiredTypeSuggested scopeWhat it does
asset_idYesstringAgent determinedThe saved dataset (CSV asset) to chart.
chart_grammarNoobjectAgent determinedThe preferred way to describe a chart: a structured specification of intent and encoding.
chart_code_snippetNostringAgent determinedA fallback for complex charts the structured form cannot express.
image_titleNostringAgent determinedA title for the chart. Required when using chart_code_snippet.

See Configuring tool parameters for what the scope column means.

A rendered chart returned as an image asset, alongside the data used to build it.