Skip to main content
Glama

add_chart

Destructive

Create and position a customizable chart in a Google Spreadsheet from a selected data range, including chart type, title, and axis labels.

Instructions

Add a chart to a Google Spreadsheet.

Creates a chart from the specified data range with customizable type, title, and positioning. The chart is added as a floating element on the sheet.

Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet containing the data chart_type: Type of chart to create. Supported types: - COLUMN: Vertical bar chart - BAR: Horizontal bar chart - LINE: Line chart - AREA: Area chart - PIE: Pie chart - SCATTER: Scatter plot - COMBO: Combination chart - HISTOGRAM: Histogram data_range: A1 notation range for chart data (e.g., 'A1:C10'). The first row is typically treated as headers. The first column is the domain (x-axis labels) and each remaining column is a series. Must name an end column: a cell-to-row ('B2:5') or row-only ('1:5') range returns an error. PIE needs exactly 2 columns, HISTOGRAM at least 1 (no domain; every column is a series), and every other type at least 2. title: Optional title for the chart x_axis_label: Optional label for the X axis (bottom axis) y_axis_label: Optional label for the Y axis (left axis) position_x: Horizontal position offset in pixels from the top-left corner (default: 0) position_y: Vertical position offset in pixels from the top-left corner (default: 0) width: Width of the chart in pixels (default: 600) height: Height of the chart in pixels (default: 400)

Returns: Result of the chart creation operation

Examples: Create a column chart showing sales data: add_chart( spreadsheet_id="abc123", sheet="Sales", chart_type="COLUMN", data_range="A1:B13", title="Monthly Sales", x_axis_label="Month", y_axis_label="Revenue ($)" )

Create a pie chart for market share:
add_chart(
    spreadsheet_id="abc123",
    sheet="Market",
    chart_type="PIE",
    data_range="A1:B5",
    title="Market Share by Product"
)

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": {
      "spreadsheet_id": "<spreadsheet_id>",
      "sheet": "<sheet>",
      "chart_type": "<chart_type>",
      "data_range": "<data_range>"
    },
    "name": "add_chart"
  }
}

Input Schema

NameRequiredDescriptionDefault
sheetYes
titleNo
widthNo
heightNo
chart_typeYes
data_rangeYes
position_xNo
position_yNo
x_axis_labelNo
y_axis_labelNo
spreadsheet_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the destructiveHint annotation, the description discloses that the chart becomes a floating element on the sheet and documents hard data_range validation rules (cell-to-row and row-only ranges error out; column requirements per chart type). It does not mention required OAuth scopes/permissions or whether an existing chart at the same position is affected, but with annotations present the bar is lower and the added validation context is substantial.

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?

Front-loaded one-line purpose followed by structured Args/Returns/Examples sections, with each argument line earning its place. The 'Returns: Result of the chart creation operation' section is empty boilerplate made redundant by the existing output schema, costing a bit of tightness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter creation tool with 0% schema documentation and an output schema that covers return values, the description supplies everything an agent needs to call it correctly: enum values, range syntax, per-type constraints, defaults, and worked examples.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden and does: every one of the 11 parameters is explained, chart_type is enumerated with eight values that appear nowhere in the schema, data_range gets A1-notation semantics plus per-type column constraints, and defaults are given for position_x/position_y/width/height.

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 ('Add a chart to a Google Spreadsheet') and immediately narrows it to creating a chart from a data range with type/title/position. An agent can distinguish this from sibling mutation tools like add_rows or add_columns without opening the schema.

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?

The two examples show concrete call patterns (column chart, pie chart), which implies when the tool is appropriate, but there is no explicit when-not guidance or pointer to an alternative for editing/removing an existing chart. Usage is implied from examples rather than stated.

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