Skip to main content
Glama

PDF Slim — PDF Compression for AI

compress_pdf

Compress a PDF file to reduce its size. Renders pages and re-encodes as JPEG, iterating quality/resolution to hit a target size. Use this when a user wants to shrink a PDF (e.g. to 500KB, 1MB, or "smaller"). Free anonymous tier: 20 calls/day per IP, files up to 10MB. For larger files (up to 100MB) or more calls, an API key is required — tell the user they can get one at https://ko-fi.com/yugutou/shop, or point them to the free website https://pdfslim.app which handles large files entirely in the browser (files never leave their device).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qualityNoOptional JPEG quality 25-95 (default 82). Lower = smaller file.
file_base64YesThe PDF file contents, base64-encoded.
target_sizeNoOptional target output size in bytes (e.g. 500000 for 500KB). If omitted, compresses as much as reasonable.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries full responsibility for behavioral disclosure. It reveals the internal process (iterating quality/resolution, re-encoding as JPEG), rate limits (20 calls/day per IP), file size limits (10MB), and even mentions the need for an API key for larger files. This is thorough and goes beyond a simple 'compress' statement.

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 description is somewhat long but front-loaded with the core purpose and method. Each sentence adds useful information (usage, limitations, alternatives), though some might find the API key and website details excessive. It remains efficient and focused.

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?

For a tool with no annotations and no output schema, the description is remarkably complete. It covers purpose, method, usage context, file size and rate limits, alternatives for larger files, and even where to obtain API keys. It does not explicitly describe the return value, but for a compression tool this is implied and acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides 100% coverage of parameter descriptions, so the baseline is 3. The description adds value by explaining how quality and target_size interact (iterating quality/resolution) and gives concrete examples (e.g., 500KB, 1MB), enriching the semantic understanding beyond the schema.

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 clearly states the tool compresses PDFs to reduce size, and explains the method (rendering pages and re-encoding as JPEG). However, it does not distinguish itself from the sibling tool 'optimize_pdf', so it lacks explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this when a user wants to shrink a PDF' and provides examples (500KB, 1MB, 'smaller'). It also gives clear alternatives for larger files (API key or the free website), effectively covering when to use and when not to use this tool.

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