Skip to main content
Glama

pdf_compress

Destructive

Create a smaller PDF copy by recompressing content streams and removing duplicate objects without re-encoding images; writes a new file and avoids overwriting by default.

Instructions

Write a smaller copy of a PDF. Lossless: it recompresses content streams and removes duplicate objects; images are not re-encoded. Writes one new file; never overwrites unless overwrite=true.

Input Schema

NameRequiredDescriptionDefault
overwriteNo
input_pathYes
output_pathYes

Output Schema

NameRequiredDescriptionDefault
pagesYes
output_pathYes
output_bytesYes
original_bytesYes
savings_percentYesNegative when the copy is larger than the input.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.1

TDQS

A4/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the lossless method (recompress streams, remove duplicate objects), that images are not re-encoded, that exactly one new file is written, and the overwrite condition. This meaningfully reassures against the destructiveHint=true annotation. It does not mention failure modes or permissions, keeping it just below top marks.

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?

Two tightly packed sentences, front-loaded with the core action and followed by the behavioral qualifiers. No filler or repetition.

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?

For a 3-param mutation tool with an output schema and rich annotations, the description covers the essential behavior (lossless, single output, overwrite gating). Minor gaps remain around path semantics and error/permission behavior, but nothing critical is missing for correct invocation.

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?

Schema description coverage is 0%, so the description carries the burden. It adds real meaning for 'overwrite' ('never overwrites unless overwrite=true') but says nothing about input_path/output_path beyond what their names convey, leaving the path parameters undocumented.

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 ('Write a smaller copy of a PDF') and immediately qualifies how ('lossless... images are not re-encoded'), which cleanly separates it from sibling tools like pdf_merge or pdf_split that also produce PDFs.

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 compression intent is implied by the lossless-recompression explanation, but there is no explicit when-to-use guidance or named alternative (e.g., vs image_optimize or other PDF tools). An agent can infer purpose but gets no routing rules.

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