UrlChart

v1.0.1
io.github.gowinder/urlchart Checked 4 days ago Published 16 days ago

Render charts as PNG images from a URL — Google Image Charts / Image-Charts compatible API.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

generate_chart_image Generate a chart image

Render a PNG chart through UrlChart and return the image plus its hosted URL. Accepts Google Image Charts / legacy parameters as an object (`{"cht":"bvg","chs":"400x200","chd":"t:10,40,80"}`) or a full legacy chart URL (Google, Image-Charts, QuickChart or urlchart.com). Without an api_key (or an Authorization: Bearer header on this MCP connection) the render is the FREE tier: a canvas of at most 1000 px per side / 1 MP, 60 requests/minute and 1,000 unique renders/month per IP. A request above that canvas is scaled down and reported in X-UrlChart-Meta, never failed. A paid api_key keeps the ful…

ParameterTypeDescription
params *Legacy chart parameters. Either an object of parameter name -> value (cht, chs, chd, chds, chl, chdl, chdlp, chxt, chxl, chxr, chxs, chxp, chxtc, chco, chtt, chts, chma, chg, chf, chbh, chls, chm (and…
api_keystringOptional UrlChart API key (uc_live_… / uc_test_…). Omit to use the free tier. Alternatively send `Authorization: Bearer <key>` on the MCP request itself.

check_legacy_chart_url Check a legacy chart URL

The migration check: analyse a Google Image Charts / Image-Charts / QuickChart URL and report, parameter by parameter, what UrlChart will render, degrade, ignore or not support — plus the equivalent UrlChart URL. Computed from the URL alone: NOTHING is rendered and no request is made to the chart host. Use this before migrating an embed to find out what changes (for example a multi-axis URL that an alternative charts it only on a paid plan).

ParameterTypeDescription
url *stringThe full legacy chart URL, including https://.

build_chart_url Build a chart URL

Build a well-formed UrlChart chart URL from a small, LLM-friendly chart spec. No render, no network, no key. Returns the URL as text; pass it to generate_chart_image (or embed it) to get the PNG. For chart types or parameters outside this spec, use generate_chart_image with raw legacy parameters.

ParameterTypeDescription
values *Data. For bar/line/pie/doughnut: one series (number[]) or several series (number[][]). For scatter: number[][] where the FIRST row is the x series and each further row a y series.
backgroundstringBackground colour (chf=bg,s,…), hex or legacy name.
chart_typestringChart family. Default bar (cht=bvg).
colorsarraySeries colours as hex (with or without #) or legacy colour names (chco).
heightinteger
labelsarrayCategory labels (chl): one per value for a single series. Omit for no labels. For scatter, labels are not used.
titlestringChart title (chtt).
widthinteger
y_maxnumberY axis maximum (chxr). Requires y_min.
y_minnumberY axis minimum (chxr). Requires y_max.