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: 25 calls/day per IP. Paid: $0.005 per 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. First observed

TDQS

A4.2/5.0
Behavior5/5

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

With readOnlyHint/openWorldHint/idempotentHint already covering the safety profile, the description adds genuinely new behavior: server-side execution, immediate file deletion with nothing stored, a 25 calls/day per-IP free tier, and $0.005/call via x402. It also states the return shape (base64 PDF plus before/after sizes), which is the key behavioral fact an agent needs to consume the result.

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?

Everything is front-loaded: what it does, how, what comes back, privacy, then cost. No filler sentences, and the telegraphic style is dense in facts rather than vague.

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 5-parameter tool with no output schema, the description is nearly sufficient: it explains the response payload, payment and quota model, and data retention. Gaps remain around password-protected PDFs and what the multi-file `files` array does relative to the singular inputs, both of which are left solely to the schema.

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 100%, so the schema already documents fileName, fileContent, password, files and the level enum; baseline is 3. The description adds only that level controls downscaling aggressiveness and that strong/medium/light are the settings, while adding nothing about the multi-file `files` array, the `password` parameter, or data-URI vs raw base64 handling beyond the schema.

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 immediately discloses the mechanism (JPEG re-encoding, downscaling, stream compression). The PDF resource scope cleanly separates it from image_compress or images_to_pdf siblings without needing to name them.

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 only implied: an agent infers you call this when you want a smaller PDF. There is no explicit when-to-use/when-not guidance and no routing to any sibling (e.g. when to prefer pdf_to_image or image_compress instead). The cost and quota lines give context for deciding whether to call, but not for choosing between tools.

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