Skip to main content
Glama
rcarmo

office-document-mcp-server

by rcarmo

office_image

Insert images into Word, Excel, or PowerPoint documents with support for PNG, JPG, and GIF. Specify target location and optional dimensions.

Instructions

Insert an image into a Word, Excel, or PowerPoint document.

Auto-detects document format from file extension and inserts the image at the specified location. Supports PNG, JPG/JPEG, and GIF formats.

Examples: # Insert image at end of Word document office_image( file_path="report.docx", image_path="logo.png", width_inches=2.0 )

# Insert image at specific paragraph in Word
office_image(
    file_path="report.docx",
    image_path="chart.png",
    target="after:Executive Summary",
    width_inches=5.0
)

# Insert image in Excel cell
office_image(
    file_path="data.xlsx",
    image_path="logo.png",
    target="A1",
    width_inches=1.5
)

# Insert image on specific Excel sheet
office_image(
    file_path="data.xlsx",
    image_path="chart.png",
    target="Sheet2!B5"
)

# Insert image on PowerPoint slide
office_image(
    file_path="deck.pptx",
    image_path="diagram.png",
    target="slide:2",
    width_inches=4.0,
    height_inches=3.0
)

Args: file_path: Path to the document (.docx, .xlsx, .pptx) image_path: Path to the image file (.png, .jpg, .jpeg, .gif) target: Where to insert the image: - Word: "after:Section Title" or "end" (default) - Excel: cell reference like "A1" or "Sheet1!B5" - PowerPoint: "slide:N" where N is slide number (1-based) width_inches: Image width in inches (height auto-scales if not set) height_inches: Image height in inches (width auto-scales if not set) output_path: Optional output path (defaults to overwriting input)

Returns: Dictionary with insertion result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the document (.docx, .xlsx, .pptx)
image_pathYesPath to the image file (.png, .jpg, .jpeg, .gif)
targetNoWhere to insert the image
width_inchesNoImage width in inches (height auto-scales if not set)
height_inchesNoImage height in inches (width auto-scales if not set)
output_pathNoOptional output path (defaults to overwriting input)
Behavior5/5

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

Annotations indicate readOnlyHint=false and destructiveHint=false. The description adds valuable behavioral details: auto-detects document format, defaults to overwriting input unless output_path specified, and explains target parameter behavior per app. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured: one-line summary, followed by auto-detection note, then comprehensive examples, and finally Args. Information is front-loaded. Every sentence is necessary given the multi-application context.

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 6 parameters, multiple document types, and no output schema, the description covers all essential aspects: supported formats, target syntax, default behavior, and return value. It is complete enough for an agent to invoke the tool correctly.

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

Parameters4/5

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

Schema coverage is 100%, so parameters are already documented. The description enhances understanding by providing detailed explanations and examples for the 'target' parameter across different document types, which is not fully captured in the schema description.

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?

Description clearly states 'Insert an image into a Word, Excel, or PowerPoint document.' It specifies supported formats (PNG, JPG/JPEG, GIF) and auto-detection. This distinguishes it from sibling tools like excel_add_chart and office_patch, which serve different purposes.

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?

Provides clear context for use via examples for each application type (Word, Excel, PowerPoint). Although no explicit 'when not to use' is given, the examples effectively guide the agent on target syntax and parameter usage. Alternatives among siblings are not mentioned, but the tool's unique function is apparent.

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/rcarmo/python-office-mcp-server'

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