Skip to main content
Glama

Compress PDF

pdf_compress

Reduce PDF file size by resaving document structure with object streams without recompressing images; reports before and after sizes so you can verify actual savings.

Instructions

Structural resave with object streams. No image recompression: text-only PDFs may barely shrink, already-optimised ones may grow. Reports before/after sizes honestly.

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": "pdf_compress"
  }
}

Input Schema

NameRequiredDescriptionDefault
outNo
pathYes
use_object_streamsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.4

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does a good job: it discloses the transformation type, that images are left untouched (so output quality is not degraded), and the counterintuitive risk that output can be larger than input. It omits whether the source file is modified in place or a new file is produced, which matters for a file-writing tool.

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 short sentences, front-loaded with the mechanism before the caveats, with no filler. 'Honestly' is mildly editorial but usefully signals that reported sizes are measured, not estimated.

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-parameter tool with no annotations and no output schema, the description covers mechanism, the main quality caveat, and the shape of the result (before/after sizes). The only material gap is the save/overwrite behavior tied to `out`.

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 must compensate. It explains what 'object streams' means for use_object_streams, but the `out` parameter is never addressed — no stated default, no statement of what happens when it is omitted (in-place overwrite?), which is the highest-risk ambiguity here.

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?

The description names the mechanism concretely ('structural resave with object streams') and states the key scope boundary ('No image recompression'), which distinguishes this size-reduction tool from content-transforming siblings like pdf_ocr or pdf_replace_text. It never says plainly 'reduce file size', relying on the name/title for the goal, but the operation is 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?

'Text-only PDFs may barely shrink, already-optimised ones may grow' implies when this tool will disappoint, which is real decision-relevant context. However, it is phrased as expectation-setting rather than guidance, and it names no alternative (e.g. pdf_inspect to check size first) or prerequisite, so the routing signal is only implied.

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