Skip to main content
Glama

PDF Compress API - make PDF files smaller

pdf_compress
Read-onlyIdempotent

Shrink a PDF: pictures re-saved as JPEG and downscaled (level strong / medium / light), streams compressed. Returns the smaller PDF as base64 with size before/after. Runs on our server, files are deleted right after the call, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.005/call via x402 at https://radarbg.com/x402/pdf-compress.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "level": "medium",
      "fileName": "sample.pdf",
      "fileContent": "JVBERi0xLjMKJeLjz9MKMSAwIG9iago8PAovUHJvZHVjZXIgKHB5cGRmKQo+PgplbmRvYmoKMiAwIG9iago8PAovVHlwZSAvUGFnZXMKL0NvdW50IDEKL0tpZHMgWyA0IDAgUiBdCj4+CmVuZG9iagozIDAgb2JqCjw8Ci9UeXBlIC9DYXRhbG9nCi9QYWdlcyAyIDAgUgo+PgplbmRvYmoKNCAwIG9iago8PAovVHlwZSAvUGFnZQovUmVzb3VyY2VzIDw8Cj4+Ci9NZWRpYUJveCBbIDAuMCAwLjAgNTk1IDg0MiBdCi9QYXJlbnQgMiAwIFIKPj4KZW5kb2JqCnhyZWYKMCA1CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAxNSAwMDAwMCBuIAowMDAwMDAwMDU0IDAwMDAwIG4gCjAwMDAwMDAxMTMgMDAwMDAgbiAKMDAwMDAwMDE2MiAwMDAwMCBuIAp0cmFpbGVyCjw8Ci9TaXplIDUKL1Jvb3QgMyAwIFIKL0luZm8gMSAwIFIKPj4Kc3RhcnR4cmVmCjI1NgolJUVPRgo="
    },
    "name": "pdf_compress"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesNoOr several files: [{fileName, fileContent (base64)}]
levelNostrong, medium or lightmedium
fileNameNoFile name with extension, e.g. report.pdf
passwordNoPDF password if it is protected
fileContentNoThe file as base64 (a data: URI is fine)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Annotations only declare readOnly, idempotent, and open-world; the description adds substantive context beyond them: the return shape (base64 plus size before/after), server-side processing with files deleted right after the call, nothing stored, and concrete rate limits (5 calls/day per IP). It also spells out the two paid paths and the X-API-Key header, which an agent needs before invoking.

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

Conciseness4/5

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

The compression behavior and return format are front-loaded in the first two clauses, with access and privacy terms following. It is dense but mostly earned; the pricing URL and euro/month detail are the only parts that read more like marketing copy than invocation guidance.

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?

With no output schema, the description correctly compensates by describing the returned base64 payload and before/after sizes, and it covers auth, quota, and retention for a 5-parameter tool. The gap is failure behavior: nothing says what happens on an unsupported or corrupt PDF, or how a password-protected file interacts with the free tier.

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 level, fileName, fileContent, files, and password, making 3 the baseline. The description adds only a thin gloss by tying the level values to compression intensity ('pictures re-saved as JPEG and downscaled (level strong / medium / light)') and says nothing about the password or multi-file 'files' parameters.

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 ('Shrink a PDF') and goes further by naming the mechanism: images re-saved as JPEG and downscaled, streams compressed. That mechanism distinguishes it from siblings like pdf_flatten or pdf_grayscale, which could also reduce file size but for different reasons.

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?

Usage is implied rather than stated: an agent can infer this is the tool to call when output size must shrink, and the level enum gives a coarse tuning axis. However, there is no explicit when-to-use or when-not-to-use guidance, and no routing against likely alternatives such as image_compress or pdf_grayscale when a smaller file is the goal.

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