Skip to main content
Glama

add_chart

Destructive

Add a chart to a Google Spreadsheet using a specified data range, chart type, title, and optional positioning. Supports multiple chart types including column, bar, line, pie, and more.

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. 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"
)

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Annotations include destructiveHint=true, but the description does not elaborate on destructiveness (e.g., irreversible addition, overwrite risk). It adds behavioral context like floating element positioning but misses details on limits, permissions, or side effects beyond annotations.

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?

The description is well-structured with args, returns, and examples, and the main purpose is front-loaded. However, it is slightly verbose due to detailed parameter descriptions and two examples; could be trimmed without losing clarity.

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?

The description covers parameters thoroughly, and an output schema exists (though not shown). Missing context includes error handling, prerequisite permissions (e.g., edit access), and behavior when default values are used. Still, it is largely complete for a tool with good annotations.

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%, but the description compensates fully by listing all 11 parameters with clear explanations, data types, defaults, and examples. This adds significant meaning beyond the schema's basic titles.

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?

The description clearly states the tool adds a chart to a Google Spreadsheet, specifies it creates from a data range with customization, and distinguishes from siblings by being the only chart-creation tool among many spreadsheet operations.

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 description explains what the tool does but provides no explicit guidance on when to use it versus alternatives (e.g., formatting cells or conditional formatting). The agent must infer usage from sibling context, as no other chart tool exists.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/socar-edwin/mcp-google-sheets-extended'

If you have feedback or need assistance with the MCP directory API, please join our Discord server