pptx_add_shape
Add a shape like rectangle or oval to a PowerPoint slide. Specify position, size, and optional text; returns the shape index.
Instructions
Add a shape (rectangle, oval, etc.) to a slide.
shape_type is one of the case-insensitive names mapped by
:data:_SHAPE_TYPE_MAP — the supported set covers the most
common MSO_SHAPE members (VAL-PPTX-042 for rectangle,
VAL-PPTX-043 for oval and rounded rectangle). An unknown
type returns ERR_INVALID_PARAMS and the deck is left
unchanged (VAL-PPTX-044).
Args:
path: Path to an existing .pptx.
shape_type: Shape type (e.g. "rectangle", "oval",
"rounded_rectangle"). See :data:_SHAPE_TYPE_MAP.
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-045).
folder: Optional base folder for relative paths.
text: Optional text to put inside the shape's text frame.
Returns:
{"shape_index": <int>} — 0-based index of the new shape
within the slide's shape list.
Raises:
OfficeMCPError: ERR_INVALID_PARAMS for an unknown shape
type, out-of-range slide, or non-numeric geometry;
ERR_FILE_NOT_FOUND if the file is missing;
ERR_UNSUPPORTED_FMT for non-.pptx extensions.
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": {
"path": "<path>",
"shape_type": "<shape_type>",
"x": "<x>",
"y": "<y>",
"w": "<w>",
"h": "<h>"
},
"name": "pptx_add_shape"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| shape_type | Yes | ||
| x | Yes | ||
| y | Yes | ||
| w | Yes | ||
| h | Yes | ||
| slide | No | ||
| folder | No | ||
| text | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||