Skip to main content
Glama

create_vega_chart

Create PNG or SVG charts from Vega-Lite specifications, save them to disk, and return the rendered image for reports, dashboards, or visual analysis.

Instructions

Create a chart from a Vega-Lite specification. Renders a Vega-Lite spec as PNG or SVG, saves to disk, and returns the image.

Example spec: {"mark": "bar", "data": {"values": [{"a": "A", "b": 28}, {"a": "B", "b": 55}]}, "encoding": {"x": {"field": "a", "type": "nominal"}, "y": {"field": "b", "type": "quantitative"}}}

Supports all Vega-Lite mark types: bar, line, area, point, circle, square, rect, arc, text, tick, rule, geoshape, trail, boxplot, errorbar, errorband. Supports layers, facets, concatenation, and repeats.

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": "create_vega_chart"
  }
}

Input Schema

NameRequiredDescriptionDefault
specYesVega-Lite specification as a JSON object. Must include "mark" and "encoding" for simple charts, or use "layer"/"hconcat"/"vconcat" for compositions.
widthNoOverride chart width in pixels (default: from spec or 400)
heightNoOverride chart height in pixels (default: from spec or 300)
autoOpenNoOpen chart in default viewer (default true)
backgroundNoOverride background color (default: from spec or "white")
outputPathNoCustom file path to save the chart
outputFormatNoOutput format: png (default) or svg

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose the key side effects: the chart is written to disk and returned as an image, and autoOpen defaults to true so a viewer may be launched. It does not cover overwrite behavior when outputPath collides with an existing file, or where output goes when outputPath is omitted.

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?

Purpose and behavior are front-loaded in the first sentence, then a compact example, then a capability list. The example earns its space by showing required spec shape, though the mark-type enumeration is somewhat long for the marginal decision value it provides.

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?

For a 7-parameter tool with a nested free-form spec object and no output schema, the description does the necessary work: it explains what the spec must contain, gives a concrete example, and states what is returned. Gaps remain around output file location defaults and autoOpen behavior in headless environments, but the core call-correctness information is present.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter including the nested spec object is already documented with defaults, and the description adds little parameter-level detail beyond reiterating PNG/SVG output. The worked example spec does add real value for constructing the most important parameter, but the remaining six parameters get no extra meaning.

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

Purpose4/5

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

The description opens with a specific verb and resource ("Create a chart from a Vega-Lite specification") and then spells out the concrete pipeline: render, save to disk, return the image. It clearly scopes the tool to Vega-Lite input, which implicitly separates it from a generic create_chart sibling, but it never names or contrasts that sibling explicitly.

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

Usage Guidelines3/5

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

Usage context is implied rather than stated: an agent can infer the tool applies when it already has a Vega-Lite spec, and the enumerated mark types and composition support (layers, facets, concat, repeat) help confirm applicability. There is no explicit when-to-use versus create_chart, no exclusion, and no prerequisite guidance such as whether a spec file or inline object is expected.

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