Skip to main content
Glama

Benchline

Compress a PDF

compress_pdf
Read-onlyIdempotent

Recompress embedded images in a PDF. Presets are light, medium, and strong. Send base64 or a public URL. Private addresses are refused. An optional target size tries harder. Returns the PDF and the sizes before and after.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic URL of a PDF. Private and local addresses are refused. Provide data or url.
dataNoPDF bytes as base64 or a data URI. Decoded size is capped at 10 MB. Provide data or url.
presetNomedium
filenameNo
mimeTypeNo
targetBytesNoOptional size ceiling in bytes, such as 102400.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesPDF bytes as base64. The original is returned when compression would grow the file.
noteYes
afterYes
pagesYes
savedYes
beforeYes
imagesYes
percentYes
metTargetYes
keptOriginalYes
recompressedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and openWorld, and the description goes beyond them usefully: "Private addresses are refused" discloses an SSRF guard, "An optional target size tries harder" explains a behavioral tradeoff, and it states the return payload. It omits failure behavior when the target cannot be met.

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?

Five short, front-loaded sentences with no filler; the core action leads, input/security/behavior notes follow. Every sentence carries information.

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

Completeness4/5

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

Given a 6-param PDF tool with an output schema, the description covers input methods, presets, the private-address guard, target sizing, and return contents. It could still clarify what each preset actually trades off, but nothing essential to invoking it is missing.

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 only 50%, and the description compensates: it names the preset values (light/medium/strong, which the enum leaves undescribed) and explains that targetBytes is an opt-in effort ceiling, adding meaning beyond the schema's terse "Optional size ceiling in bytes." filename and mimeType remain unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Recompress embedded images in a PDF" is a specific verb+resource that clearly separates it from compress_image and the other PDF siblings by operating on the PDF itself. It does not explicitly name alternatives or scope boundaries, but the resource framing makes the intent unambiguous.

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 description supplies operating context (presets, base64-or-URL input, an optional target size) but never states when to pick this over compress_image, resample elsewhere, or which preset to prefer for a given goal. Usage is implied rather than guided.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources