insert_sheet_sparkline

Insert an in-cell SPARKLINE chart by writing the formula for you.

writeGoogle Sheets, Docs & Drive

Sheets SPARKLINEs are tiny inline charts — use them in dashboard rows (one per metric) instead of full add_sheet_chart calls. Much smaller footprint, much faster.

Call it

In an AI client (MCP)

tools/call
{
  "name": "insert_sheet_sparkline",
  "arguments": {
    "spreadsheet_id": "<spreadsheet_id>",
    "target_cell": "<target_cell>",
    "data_range": "<data_range>"
  }
}

From code (Tool API)

curl -X POST https://api.sellersheetai.com/api/v1/tools/insert_sheet_sparkline \
  -H "Authorization: Bearer $SELLERSHEET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"spreadsheet_id":"<spreadsheet_id>","target_cell":"<target_cell>","data_range":"<data_range>"}'
Early access — the Tool API is open on request, contact us.

Arguments

NameTypeDescription
spreadsheet_idrequiredstringthe spreadsheet ID (from its URL or get_sheet_metadata).
target_cellrequiredstringA1 target cell to host the sparkline (e.g. 'Dash!F2').
data_rangerequiredstringthe data series as it would appear in a formula, without '=' (e.g. 'Sales!B2:G2'). Pass the tab name bare ('STA-BoxFirst!B2:G2'); the server quotes it.
sparkline_typestring'line' (default) | 'column' | 'winloss'.Default: "line"
colorstringOptional. Either a Sheets color name string ('red', 'blue', etc.) OR an RGB list [r,g,b] floats 0–1 which is converted to a #RRGGBB hex literal.
line_widthintegerOptional integer (only applies to 'line' type).

Result

Every tool answers {notification, data, human_action}; data carries:

  • data.formula — the SPARKLINE formula written to data.targetCell.

Example

insert_sheet_sparkline("1ABC...", "Dash!F1", "Dash!A1:E1",
                       sparkline_type="line", color="red")
# Column type with explicit RGB green
insert_sheet_sparkline("1ABC...", "Dash!F2", "Dash!A2:E2",
                       sparkline_type="column",
                       color=[0.0, 0.8, 0.0])

On this page

Actions

View as Markdown

Ask an assistant

Ask ChatGPTAsk Claude