Skip to main content
Glama
pdf-toolkit-mcp

pdf-toolkit-mcp

by 0xmortuex

extract_images

Extract embedded images such as photos, scans, and logos from PDF files and save each one as a separate file in its original format, with optional page selection and output directory control.

Instructions

Save the images embedded in a PDF (photos, scans, logos) as files named p., in their original format where possible. Lists the files written. Vector drawings and text are not images and are not extracted.

output_dir: default _images next to the input. Created if missing. max_images: safety cap; the call fails (writing nothing) if more are found.

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>"
    },
    "name": "extract_images"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
pagesNo
passwordNo
overwriteNo
max_imagesNo
output_dirNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description adds genuinely new behavior: files are written to disk, output_dir is created if missing, images keep their original format where possible, and max_images is enforced as an all-or-nothing cap that writes nothing on overflow. It does not describe what overwrite=true actually replaces, which is the main remaining behavioral gap.

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?

Front-loaded with the action and naming scheme, then a compact parameter block; every sentence carries information. Minor waste in listing example image types, but it usefully disambiguates scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, so return values needn't be explained, and the write semantics and failure mode are covered. But for a 6-parameter mutating tool with 0% schema coverage, leaving overwrite, pages, password, and path undocumented makes the definition incomplete for correct invocation.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must carry the parameters, yet it explains only output_dir (default value and creation behavior) and max_images (fail-fast cap). The path, pages (format unspecified), password, and overwrite parameters receive no meaning at all, and overwrite in particular determines whether existing files are destroyed.

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 and resource ('Save the images embedded in a PDF ... as files'), gives the output naming convention, and explicitly rules out vector drawings and text. An agent can tell immediately whether this is the right tool for image extraction versus page or table extraction.

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 exclusion of vector drawings and text implies when NOT to expect results, but no sibling alternative is named (e.g. extract_pages for page rendering) and there is no guidance on prerequisites such as encrypted PDFs beyond the password param. Usage is inferable but not spelled out.

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