Skip to main content
Glama

Extract images from Office files

extract_office_images

Extract every image embedded in a .docx, .xlsx, or .pptx file into one ZIP at original quality, returning the saved path and image count without altering the source file.

Instructions

Save every picture embedded in a .docx, .xlsx or .pptx into one ZIP, at original quality. Returns the saved path and the image count; a file without pictures returns an error. The input is not changed.

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": {
      "file": "<file>"
    },
    "name": "extract_office_images"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesPath to the file (absolute, or relative to the working directory).
outputNoWhere to save the result. Defaults to a new file next to the input.

Output Schema

NameRequiredDescriptionDefault
notesYesAnything the output does not carry over from the input.
summaryYesOne line describing the result.
writtenYesPaths of the files written, in order.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.2

TDQS

A4.1/5.0
Behavior4/5

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

Beyond the annotations, the description discloses the ZIP aggregation, original-quality preservation, the returned values (saved path plus image count), the error case for picture-free files, and that the input file is untouched – which reconciles the readOnlyHint=false with a non-destructive guarantee. It doesn't cover behavior on partial failure or overwriting an existing output path.

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?

Three compact sentences, front-loaded with the core action and format support, then return values, then a safety note. No redundant or filler wording.

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?

For a two-parameter extraction tool with annotations and an output schema, the description covers inputs handled, output artifact, return values, error condition, and input preservation – nothing material an agent needs before calling it is missing.

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

Parameters3/5

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

With 100% schema description coverage, the schema already explains both parameters including the default for 'output'. The description only indirectly informs the 'output' parameter by saying the result is a single ZIP, without adding format details or naming rules; baseline 3 applies.

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?

States a specific verb+resource ('Save every picture embedded in...') plus the exact input formats (.docx, .xlsx, .pptx) and the output shape (one ZIP at original quality). This clearly separates it from siblings like images_to_pdf, remove_image_metadata, or clean_office.

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 supported file types and the ZIP-output target establish the usage context implicitly, but there is no explicit when-to-use/when-not guidance and no sibling is named as an alternative (e.g., for PDFs an agent must infer extract_pdf_pages).

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