Skip to main content
Glama

Render ECharts to image

echarts_to_image

Render an Apache ECharts option object server-side to PNG, JPEG, WebP, AVIF or SVG without a browser, with themes, background color and raster scale control.

Instructions

Render an Apache ECharts option object server-side (SVG renderer, no browser) and save it as PNG, JPEG, WebP, AVIF or SVG. Supports themes, background color and raster scale.

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": {
      "option": "<option>"
    },
    "name": "echarts_to_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
scaleNoRaster scale. 2 renders a 2x resolution image. Ignored for SVG output.
themeNoBuilt-in theme name (for example dark) or an ECharts theme object.
widthNoChart width in CSS pixels. Defaults to 1000.
heightNoChart height in CSS pixels. Defaults to 600.
optionYesECharts option object (the setOption payload). A JSON string is also accepted.
qualityNoEncoder quality (1-100). Applies to JPEG, WebP, AVIF and TIFF output.
losslessNoUse lossless encoding where supported (WebP and AVIF).
file_nameNoOptional base file name; path separators are not allowed. The actual image format determines the extension. When multiple outputs are produced, -1, -2, ... suffixes are appended. Existing files are never overwritten.
backgroundNoChart background color. Defaults to option.backgroundColor, or white. Use transparent for an alpha background.
output_dirNoAbsolute directory where the output file is saved. Defaults to IMG_OUTPUT_DIR, or ~/img-output. The directory is created automatically.
output_formatNoOutput format. Defaults to PNG.png
compression_levelNoPNG compression level (0-9); higher is smaller and slower.

Output Schema

NameRequiredDescriptionDefault
imageYes
detailsNo
operationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=false), and the description adds useful rendering context: SVG renderer, server-side, no browser. However it omits the write-side behavior an agent would want — that files are never overwritten, that suffixes are appended for multiple outputs, and that the output directory is auto-created — despite all of that mattering for a non-idempotent file-producing tool.

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?

Two compact clauses with the core operation front-loaded and zero filler wording. It is efficient, though its brevity leaves the 12-parameter surface almost entirely to the schema.

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?

With a fully described schema, an output schema, and annotations present, the description covers the essential identity of the tool. The main residual gap is routing guidance among the many image siblings and any note on file-output semantics, which are left to structured fields.

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 one of the 12 parameters is already documented in the schema. The description merely restates themes, background color and raster scale, adding no syntax, defaults, or interaction details beyond what the schema provides. Baseline 3 is appropriate.

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 an Apache ECharts option object server-side and save it in one of five named formats. The mention of 'ECharts option object' and 'no browser' immediately distinguishes it from siblings like html_to_image or generate_image.

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 is implied by the input contract (you must supply an ECharts option object), which effectively narrows the audience, but there is no explicit when-to-use versus html_to_image or generate_image, and no stated prerequisites or failure conditions.

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