Skip to main content
Glama

Chart to SVG/PNG

ai_chart
Read-onlyIdempotent

Render bar, line, area, pie, or scatter charts offline to SVG or PNG from simple row data or a full Vega-Lite/Vega spec with inline data.

Instructions

Render a chart to an SVG or PNG file, offline. Either give a simple description ({ type: bar|line|area|pie|scatter, data: rows, x, y, color?, title? }; y may be a list of fields for multi-series line/bar charts), or a full Vega-Lite (or Vega) spec in "spec" with the rows inline in data.values. Field types are inferred (numbers = quantitative, ISO dates = temporal, other = categories). Loading data or images from URLs or files is refused. Up to 50,000 rows. PNG is rasterised from the SVG at "scale" (default 2×).

Input Schema

NameRequiredDescriptionDefault
xNoField for the x axis (the category / slice label for pie).
yNoNumeric field for the y axis (slice size for pie). A list of fields draws one series per field.
dataNoRows for the simple chart, e.g. [{"month":"Jan","sales":12}].
specNoA full Vega-Lite spec (or Vega, if its $schema says so). Data must be inline (data.values). Use this or "type".
typeNoSimple chart type. Use with data, x and y.
colorNoOptional field that splits the data into coloured series.
scaleNoPNG only: pixel density multiplier (2 = twice the SVG size, sharp on high-DPI screens). Default 2.
titleNo
widthNoPlot width in px (default 600; pie 360).
formatNoOutput format: svg (default) or png.svg
heightNoPlot height in px (default 360).
outputNoWhere to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set).
backgroundNoBackground colour. Default white; "transparent" for none.#ffffff
returnBase64NoAlso return the output as base64 in the result (only for small files). Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/idempotent/openWorld annotations, the description discloses offline operation, refusal to load data or images from URLs/files, a 50,000-row cap, and that PNG is rasterised from SVG at 'scale' (default 2×). These sandbox and size constraints are materially useful calling context the annotations don't carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then the two input modes, then constraints and the PNG scale detail. It's dense but every clause (refusals, row cap, field inference) earns its place for a 14-parameter tool; the semicolon-heavy single paragraph slightly hurts scanability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 14 params, nested 'spec', and no output schema, the description covers both invocation paths and limits well. It doesn't state the return value explicitly (file path vs. base64), which matters without an output schema, keeping it just short of complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 93%, so the baseline is 3, but the description adds genuine meaning: type inference rules (numbers = quantitative, ISO dates = temporal, else categories) and that y may be a list of fields for multi-series charts. This complements the schema rather than repeating it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Render a chart to an SVG or PNG file, offline') and immediately enumerates the two supported input modes. An agent can tell this apart from sibling tools like ai_diagram or image_svg_to_png without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly frames the two mutually exclusive invocation paths (simple {type, data, x, y} vs. a full Vega-Lite/Vega 'spec') and notes field-type inference and what is refused. It stops short of naming a sibling alternative (e.g., ai_diagram for flowcharts), so it's clear context without exclusions across tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools