chart_spec
Create Vega-Lite charts and get a rendered PNG with automatic diagnostics for layout defects such as label collisions, zero baselines, and excessive series.
Instructions
Write a Vega-Lite chart as a SOURCE DOCUMENT: .vl.json +
a rendered .png land in out_dir (use the artifact scratch
when the user asked to SEE it — the workspace opens it beside the
conversation, live and editable). Pass data= to inline a frame (capped at max_rows — aggregate big
data in the kernel first); a handle reads from the store, so it
charts even after the kernel that made it died. THE RENDER COMES
BACK ATTACHED TO THIS RESULT —
look at it directly, no second read — alongside diagnostics,
deterministic layout checks (label collisions, a zero baseline
flattening the data, too many series) that name defects the image
alone makes you squint for. Rendering is local (vl-convert,
Vega-Lite v6).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"spec": "<spec>",
"name": "<name>",
"out_dir": "<out_dir>"
},
"name": "chart_spec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| name | Yes | ||
| spec | Yes | ||
| out_dir | Yes | ||
| max_rows | No |