Skip to main content
Glama

pdf_compress

Read-onlyIdempotent

Shrink a PDF. Default aims for about 50% smaller: tidies structure first (text untouched), then shrinks pictures only as much as needed. level: auto (default), medium, strong. targetFileSize (such as 2MB or 500KB) is the size to end at, for auto; default is half the original.

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": {
      "fileBase64": "<fileBase64>"
    },
    "name": "pdf_compress"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelNoLevel: one of auto, medium, strong.
fileBase64YesThe input file as a base64 string, without a data: prefix.
targetFileSizeNoWanted size, for example 500KB or 2MB. Best effort.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / fileBase64 / description
      Added value: +"The input file as a base64 string, without a data: prefix."
    • addedInput schema / properties / level / description
      Added value: +"Level: one of auto, medium, strong."
    • addedInput schema / properties / targetFileSize / description
      Added value: +"Wanted size, for example 500KB or 2MB. Best effort."
  2. Changed2 schema fields changed
    • addedInput schema / properties / targetFileSize
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / targetPercent
      Removed value: -{
      -  "maximum": 95,
      -  "minimum": 1,
      -  "type": "number"
      -}
  3. Changed2 schema fields changed
    • addedInput schema / properties / level
      Added value: +{
      +  "enum": [
      +    "auto",
      +    "medium",
      +    "strong"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / targetPercent
      Added value: +{
      +  "maximum": 95,
      +  "minimum": 1,
      +  "type": "number"
      +}
  4. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description adds genuinely useful behavior: text is untouched, images are degraded only as much as needed, and the size target is best-effort rather than guaranteed.

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?

Roughly three sentences, front-loaded with the outcome and default, then level options, then the size target. Telegraphic phrasing ("Shrink a PDF.") is dense but every clause carries information; nothing is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description never says what comes back (base64 payload? file reference?) or how a partial success — "best effort" — is reported. For a base64-in/base64-out compression tool, that return-value gap is the main missing piece; the input side is adequately covered.

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?

Schema coverage is 100%, so 3 is the baseline, and the description exceeds it: it states that level defaults to auto, that targetFileSize applies "for auto," and that its default is half the original size. That adds real meaning beyond the schema's one-line "Wanted size... Best effort," though the qualitative difference between medium and strong is still unexplained.

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?

"Shrink a PDF" is a clear verb+resource, and the description adds concrete mechanics (structure cleanup first, then image downsampling). It never distinguishes this tool from the many compression siblings (pdf_compress_aggressive, _balanced, _extreme, _size, _smallest_bw, etc.), so an agent cannot tell from this text which compressor to pick.

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?

It gives default behavior (about 50% smaller, auto level) and ties targetFileSize to the auto level, which is implied usage guidance. But with seven pdf_compress* siblings in the catalog, there is no explicit "use this when / use X instead" routing, no exclusions, and no prerequisites, so selection remains guesswork.

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