ChartKitMCP docs

Tools

Every tool the server lists, with its parameters and what it returns.

Call a tool with a JSON-RPC tools/call request whose params hold the tool name and its arguments. Every result has a content array with one text block, written for an AI assistant. Most tools also return structuredContent, the fields your code should read.

ToolDoesAPI key
create_chartBuild and store a chart from data. visualize_data is the same tool.Yes
update_chartChange an existing chart's data, type or text by id.Yes
get_chart_svgReturn a chart's SVG markup.Yes
get_live_chart_embedReturn an HTML page that shows a chart and stays current.Yes
insert_chart_into_slidesInsert a chart into a deck the signed-in person has open.No
list_open_decksList the decks the signed-in person has open in Chrome.No
list_charts_in_deckList the ChartKit charts in an open deck.No
save_chart_modelUsed by the chart widget's Edit button only.Yes

tools/list returns each tool's JSON Schema. The descriptions in it are written to steer an AI assistant. This page describes the same tools for developers.

create_chart

Builds a chart from data, stores it and returns its id and hosted image URLs. visualize_data is the same tool under a second name, with the same input and result; AI assistants find it more easily. From code, call create_chart.

The arguments are the chart input: chart_type, table and optional fields for the unit, callouts, focus and style. Chart input documents each field. One more field applies to this tool only:

sizeobjecteach side 72 to 1440

The box the image will fill on the slide, in points, such as { "width_pt": 648, "height_pt": 259 }. A 16:9 Google Slides page is 720 × 405 points. ChartKit lays the chart out for the box, keeping its normal text size, and returns sizePt. Send it when your code inserts the image itself. Not for custom charts.

Result

structuredContent.chartIdstring

The chart id. Use it with update_chart, get_chart_svg and get_live_chart_embed.

structuredContent.imageUrlstring

Hosted PNG on a white background, rendered at twice the chart size on first request. The v query parameter pins this version of the chart. Public, no authentication.

structuredContent.svgUrlstring

Hosted SVG of the same version.

structuredContent.slidesAltTextstring

ChartKit: followed by the chart id. Set it as the alt text description of the image in Google Slides so the ChartKit extension can open the chart for editing.

structuredContent.sizePtobject

{ width, height } in points: the size to insert the image at. It fits inside size, and the PNG is sizePt × 8/3 pixels. An image inserted at this size opens in the ChartKit extension with the layout it was drawn with. With a team API key that holds without size too; through OAuth without size, the extension sizes the chart when it inserts it. Absent for custom charts.

structuredContent.modelobject

The stored ChartKit table and spec, and the palette the chart was drawn with.

content[0].textstring

A summary for an AI assistant: the chart id and URLs, numbers ChartKit computed (such as a CAGR), the callout it added, and notes about input it adjusted. Read it for logs; do not parse it.

tools/calljson
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_chart",
    "arguments": {
      "chart_type": "stackedBar",
      "table": {
        "categories": ["2022", "2023", "2024", "2025"],
        "series": [{ "name": "Instagram" }, { "name": "TikTok" }, { "name": "YouTube" }],
        "values": [[120, 135, 150, 160], [60, 95, 140, 190], [80, 85, 90, 92]]
      },
      "unit": "k mentions",
      "highlight": { "series": ["TikTok"] }
    }
  }
}

Input that does not validate returns a JSON-RPC error with code -32603 and a message naming the field, for example table.values[1] (series "TikTok") must be an array of 4 numbers, one per category (2022, 2023, 2024, 2025); it has 3.

update_chart

Changes a stored chart by id and returns the new image URLs. Send only the fields that change. A signed-in person's open decks that contain the chart get the new version automatically.

chart_idstringrequired

The id from create_chart or list_charts_in_deck.

chart_typestring

Switch to another native type with the same data. Gantt and custom charts keep their type.

stackedBarstackedBar100clusteredBarlinescatterwaterfalldonutmekkobubbleharveyBall
Any chart input fieldvaries

Every other chart input field except size, which stays as the chart was created. table, annotations and highlight replace the previous value whole. colors adds to earlier colours. Send annotations: [] to remove callouts, and "" for title, subtitle or footnote to remove it.

Charts that people built by hand in the extension accept a narrower set: table, title, subtitle, footnote, axis titles, legend, value_labels, colors, highlight, sort on single-series bars, and a chart_type between bar and line types. Other fields are left unchanged and listed in the result text.

Result

structuredContent.chartIdstring
structuredContent.imageUrlstring

PNG of the new version. The previous version's URLs return 404 from now on.

structuredContent.svgUrlstring
structuredContent.sizePtobject

The size to insert the new image at. The chart keeps the size it was created with, so this usually matches the image already on the slide; when it does not, insert the new image at this size instead of replacing the old one.

modelobject

The stored chart: the ChartKit table and spec, and the palette (series colours) it was drawn with.

structuredContent.refreshedarray

One entry per open deck of the signed-in person that was checked.

Entry fields
deckIdstring
deckTitlestring
replacedboolean

Whether the chart was found and replaced in that deck.

slideIndexesnumber[]

1-based slides where it was replaced.

timeoutboolean

Present when the deck did not answer in time.

errorstring

Present when replacing failed in that deck.

tools/calljson
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "update_chart",
    "arguments": {
      "chart_id": "q3Vt8wXc_LmZ0aBf",
      "table": {
        "categories": ["2022", "2023", "2024", "2025", "2026"],
        "series": [{ "name": "Instagram" }, { "name": "TikTok" }, { "name": "YouTube" }],
        "values": [[120, 135, 150, 160, 166], [60, 95, 140, 190, 230], [80, 85, 90, 92, 95]]
      }
    }
  }
}

An unknown chart_id, or a type change to or from gantt or custom, returns a result with isError: true. A call with nothing to change returns JSON-RPC error -32602.

get_chart_svg

Returns the SVG markup of a stored chart as text. To embed a chart in a page, the svgUrl is usually simpler.

chart_idstringrequired
text_scalenumber

Draw all text this many times larger, from 1 to 2, while the chart keeps its width. Omit for the saved size.

Result

content[0].textstring

The SVG markup, about 20 KB. There is no structuredContent.

tools/calljson
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": { "name": "get_chart_svg", "arguments": { "chart_id": "q3Vt8wXc_LmZ0aBf", "text_scale": 1.25 } }
}

An unknown chart id returns JSON-RPC error -32602.

get_live_chart_embed

Returns a small HTML page that shows a chart and re-reads it every 30 seconds through the person's ChartKit connector, so it follows later update_chart calls. It is built for claude.ai artifacts. Send either chart_id or chart data, not both.

chart_idstring

An existing chart. With it, title becomes a heading above the chart.

Chart input fieldsvaries

To build a new chart, the same fields as create_chart. Then title is the chart's own title.

connector_namestringdefault "ChartKit"

The name the person gave the connector in claude.ai. The page calls the connector by this name.

Result

structuredContent.chartIdstring
content[0].textstring

Publishing instructions followed by the HTML page, about 3 KB.

insert_chart_into_slides

Inserts a stored chart into a Google Slides deck that the person has open in Chrome, as an editable ChartKit chart, on the selected slide or on slide_number. The extension in that tab does the insert.

Needs a signed-in person

This tool acts on decks that the signed-in person has open in Chrome with the ChartKit extension. It is not available with a team API key.

chart_idstringrequired
deckstring

A Google Slides URL or part of the deck title. Omit for the deck the person focused last.

slide_numberinteger

1-based slide to insert on. Omit for the selected slide.

modestringdefault "commit"

commit places the chart. open opens it in the ChartKit editor in the deck instead.

commitopen

Result

structuredContent.messagestring

One line saying what happened. Present on every outcome.

structuredContent.deckIdstring
structuredContent.deckTitlestring
structuredContent.slideIdstring
structuredContent.slideIndexnumber
structuredContent.committedChartIdstring

The id of the chart as committed to the deck.

When no deck is open, the deck does not answer, or deck matches none of the open decks, the result has isError: true. A deck mismatch lists the open decks in structuredContent.decks.

list_open_decks

Lists the Google Slides decks the person has open in Chrome with ChartKit, most recently focused first. It takes no arguments.

Needs a signed-in person

This tool acts on decks that the signed-in person has open in Chrome with the ChartKit extension. It is not available with a team API key.

structuredContent.decksarray
Entry fields
deckIdstring
titlestring
slideIndexnumber

The selected slide, 1-based.

focusedAtnumber

When the deck last had focus, in milliseconds since the epoch.

list_charts_in_deck

Lists the ChartKit charts in an open deck with their slide and chart id, so you can change one with update_chart.

Needs a signed-in person

This tool acts on decks that the signed-in person has open in Chrome with the ChartKit extension. It is not available with a team API key.

deckstring

A Google Slides URL or part of the deck title. Omit for the deck the person focused last.

Result

structuredContent.deckIdstring
structuredContent.deckTitlestring
structuredContent.chartsarray

Up to 60 charts.

Entry fields
chartIdstring
slideIdstring
slideIndexnumber
titlestring
structuredContent.truncatedboolean

Present and true when the deck has more than 60 charts.

structuredContent.partialboolean

Present and true when ChartKit could only read the current slide and charts made in this browser. partialReason says why.

save_chart_model

Stores a chart model edited by hand in the chart widget that MCP Apps hosts such as claude.ai show. Only the widget's Edit button calls it, and its _meta.ui.visibility is ["app"]. Use update_chart from code.

Other methods

Besides tools/list and tools/call, the server answers these JSON-RPC methods.

MethodReturns
initializeServer info, capabilities and usage instructions for AI assistants.
pingAn empty result.
resources/listThe chart widget and its scripts, used by hosts that support MCP Apps.
resources/readA resource by uri. An unknown uri returns error -32002.
resources/templates/listAn empty list.

A POST that holds only notifications, such as notifications/initialized, gets HTTP 202 with no body. Any other method returns error -32601.