Skip to main content
Glama

PDF Efforts

Compress PDF

compress_pdf
Idempotent

Reduce PDF file size with Ghostscript, keeping text as text. Either pick a quality level, or give target_kb to get the best-quality file under that size (reports whether the target was met).

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": {
      "file": "<file>"
    },
    "name": "compress_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesThe PDF to compress.
levelNolight = best quality, strong = smallest file. Ignored when target_kb is set.balanced
grayscaleNoAlso convert to grayscale (much smaller for scans).
target_kbNoOptional maximum size in KB (e.g. 200). The server searches for the best quality that fits.
remove_imagesNoDrop all images, keeping only text and vector drawings.

Output Schema

NameRequiredDescriptionDefault
infoNoFacts about the PDF (get_pdf_info) or the result (e.g. target_met for compress_pdf).
noteNoAnything the user should know about the result.
textNoExtracted text (pdf_to_text, ocr_pdf).
filesYesResult files. Download them before expires_at; pass file_id to another tool to chain.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare readOnly=false, idempotent=true, destructive=false, openWorld=true; the description adds genuinely new behavior — Ghostscript as the engine, text preserved as text, and a search for the best quality under the target that reports whether the target was met. It omits the practical cost of that search (iterative recompression is slower) and whether the result is a new artifact versus a replacement.

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 with the core operation front-loaded and the alternative mode stated second. No filler, no restatement of the title.

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?

An output schema exists, so return values need not be spelled out, and the description still notes that target success is reported. All five parameters are covered by the schema and the two-mode model is fully explained, leaving nothing an agent needs in order to call this correctly.

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 coverage is 100%, so the schema already documents every parameter including the level enum ordering and the target_kb bounds. The description only reinforces the precedence rule between level and target_kb and adds the quality-preservation intent, which is marginal added meaning over structured data.

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?

States a specific verb and resource ('Reduce PDF file size') plus the engine ('with Ghostscript') and a quality guarantee ('keeping text as text'). It does not name or exclude any sibling (e.g. optimize_pdf_for_web or grayscale_pdf), so differentiation is left to inference, but the operation itself is unmistakable.

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 either/or mode rule: 'Either pick a quality level, or give target_kb', and the schema confirms level is ignored when target_kb is set. It offers no exclusions against siblings such as optimize_pdf_for_web or the dedicated grayscale_pdf, and never mentions the grayscale flag's relationship to that sibling.

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