Skip to main content
Glama

pptx_add_chart

Add a chart to a PowerPoint slide by specifying chart type, data with categories and series, and position, returning the new shape index.

Instructions

Add a chart to a slide.

The data argument must follow the structure documented in :func:_build_chart_data: a dict with "categories" (list of x-axis labels) and "series" (list of {"name", "values"} dicts).

Args: path: Path to an existing .pptx. chart_type: One of column, bar, line, pie, etc. — see :data:_CHART_TYPE_MAP. (VAL-PPTX-051, VAL-PPTX-052.) data: Chart data structure with categories and series keys (VAL-PPTX-051). x: Left edge in inches. y: Top edge in inches. w: Width in inches. h: Height in inches. slide: 0-based slide index (VAL-PPTX-055). folder: Optional base folder for relative paths.

Returns: {"shape_index": <int>} — 0-based index of the new chart within the slide's shape list.

Raises: OfficeMCPError: ERR_INVALID_PARAMS for unknown chart_type (VAL-PPTX-053), empty series (VAL-PPTX-054), out-of-range slide (VAL-PPTX-055), or non-numeric geometry; ERR_FILE_NOT_FOUND if the file is missing; ERR_UNSUPPORTED_FMT for non-.pptx extensions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
chart_typeYes
dataYes
xYes
yYes
wYes
hYes
slideNo
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully carries the burden. It details return values (shape_index), raised errors with specific codes (ERR_INVALID_PARAMS, ERR_FILE_NOT_FOUND, etc.), and conditions for each error.

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, Raises sections. Slightly lengthy due to detailed parameters, but every sentence adds value. Could be slightly more concise.

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 9 parameters (7 required), nested objects, and no output schema in structured form, the description covers input, output, errors, and parameter details comprehensively. It is complete.

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?

The schema has 0% description coverage, so the description adds crucial meaning. It explains the data structure, chart_type options, geometry parameters, and optional folder. It goes well beyond the schema.

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 'Add a chart to a slide', using a specific verb and resource. It distinguishes itself from sibling tools like pptx_add_image or pptx_add_shape by focusing on charts.

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 explains when to use the tool (to add a chart) and provides detailed parameter guidance. However, it does not explicitly mention when not to use it or compare with alternatives like excel_add_chart.

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