Skip to main content
Glama
EthanCheung-gh

PDF Inspector MCP

pdf_get_image

Retrieve an embedded PDF image's complete base64 payload by stream_id after extracting pages, so you can save or process the original image data.

Instructions

Fetch one embedded image's bytes as base64, addressed by the stream_id reported for that image.

Call pdf_extract_page/pdf_extract_document first and take stream_id from an object of type image (p<page>_img_<index>, index is 0-based within the page). On success returns {'base64', 'format', 'mime_type', 'byte_length'} with the full, untruncated payload; images in non-web formats are transcoded to PNG. On failure returns {'error': '...'} unchanged.

The complete base64 payload is always returned inline: this tool is the one deliberate exception to the 1 MB inline limit the other tools enforce, because the image is the whole point of the call. Large images therefore produce a large response.

Input Schema

NameRequiredDescriptionDefault
pathYesPath to the PDF: absolute, or relative to the server process working directory. Any readable regular file is accepted; the .pdf suffix is not required.
passwordNoPassword for an encrypted PDF. Omit or pass null for unprotected documents.
stream_idYesImage identifier from a page's images array, in the form 'p<page>_img_<index>'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses the return shape, PNG transcoding of non-web formats, error passthrough, and the deliberate exemption from the 1 MB inline limit with the consequence of large responses. That size caveat is exactly the kind of trait annotations would otherwise miss.

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

Conciseness3/5

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

Front-loaded with the core action and prerequisite, but the final paragraph restates the inline-payload point at length (two sentences on the same 1 MB exception). Useful, yet it could be compressed to one line without losing information.

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?

No output schema exists, yet the description fully specifies the return keys, error form, transcoding behavior, and the size implication. An agent has everything needed to call it and interpret the result.

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 the baseline is 3, but the description adds detail the schema omits, notably that the index is 0-based within the page. Combined with the stream_id format it gives the agent extra confidence in constructing the argument.

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 (fetch) and resource (one embedded image's bytes as base64) plus the addressing key (stream_id). It explicitly distinguishes itself from siblings by requiring pdf_extract_page/pdf_extract_document first, so an agent can tell exactly what this does versus those tools.

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?

Gives an explicit prerequisite workflow: extract page/document first, then take stream_id from an object of type image. This makes the when-to-use clear relative to siblings, though it doesn't state when not to use it or what to do if the image is already cached.

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