Skip to main content
Glama

excel_add_chart

Add a chart to an Excel sheet anchored at a target cell, with data from a specified range. Supports bar, line, pie, area, and scatter chart types.

Instructions

Add a chart to a sheet, anchored at target_cell.

Supported chart_type values: "bar", "line", "pie", "area", "scatter". Any other value raises :class:OfficeMCPError with ERR_INVALID_PARAMS (VAL-EXCEL-056) and the workbook is not modified.

The chart's data is read from data_range (e.g. "A1:B5"); the first column is treated as categories and subsequent columns as series. The chart is anchored at target_cell (e.g. "D2") so its top-left corner coincides with that cell (VAL-EXCEL-052).

Args: path: Path to an existing .xlsx. sheet: Name of the sheet that will own the chart. chart_type: One of "bar", "line", "pie", "area", "scatter". data_range: A range reference like "A1:B5". target_cell: A single cell reference like "D2". The chart's top-left anchor is set to this cell. title: Optional chart title. When supplied, it is set via openpyxl's title API and survives a reload. folder: Optional base folder for relative paths.

Returns: {"ok": True}.

Raises: OfficeMCPError: ERR_FILE_NOT_FOUND if the file is missing, ERR_SHEET_NOT_FOUND for an unknown sheet, ERR_INVALID_PARAMS for an unknown chart_type or malformed data_range / target_cell, ERR_CELL_PARSE for a malformed range, ERR_UNSUPPORTED_FMT for non-.xlsx extensions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
sheetYes
chart_typeYes
data_rangeYes
target_cellYes
titleNo
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Despite no annotations, the description thoroughly discloses behavior: chart type validation with error, data interpretation, anchoring, return value, and all error conditions. This gives a complete operational model.

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 and front-loaded with the main action, but it is somewhat lengthy due to detailed parameter descriptions and error lists. Some conciseness could be gained, but it remains clear.

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?

Given the complexity (7 parameters, no annotations, simple output schema), the description covers all necessary aspects: parameters, return value, error conditions, and data interpretation. It is complete for correct agent use.

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 coverage is 0%, but the description provides comprehensive parameter explanations with examples, valid values, and behavioral implications for all 7 parameters (including optional ones). This fully compensates for the schema's lack of descriptions.

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 verb 'Add' and resource 'chart to a sheet', with specific anchoring and supported chart types. It uniquely identifies the tool among siblings like excel_write_cell, making purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for adding a chart but does not explicitly specify when to avoid this tool or mention alternative tools. The purpose is well-defined, so usage is implied, but lacks explicit comparisons.

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/gawirable/office-mcp'

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