Skip to main content
Glama

pdf_compress_smallest_bw

Read-onlyIdempotent

Shrink a scanned PDF from freedailypro to the smallest black-and-white file: JBIG2 symbol mode stores each letter shape once and reuses it across pages, typically 3x smaller than the lossless black-and-white file. Very rarely a letter can be swapped for a look-alike one (for example a 6 and a 8 in tiny print), so check important numbers in the original. Colour and shading are lost and text on converted pages is no longer selectable. A page is converted only when that makes it at least 10% smaller; other pages are copied untouched. Errors if the PDF is unreadable, password-protected, over 100 pages, or if no smaller file results.

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_smallest_bw"
  }
}

Input Schema

NameRequiredDescriptionDefault
dpiNoRender resolution, 100 to 200. Default 150
thresholdNoHow alike two letter shapes must look to share one stored shape, 0.4 to 0.9. Default 0.85; higher is safer and slightly larger
fileBase64YesThe PDF, base64 encoded (up to 20 MB, up to 100 pages)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the read-only annotations: discloses the JBIG2 look-alike glyph risk ('a 6 and a 8'), loss of colour and text selectability, the per-page 10%-smaller conversion heuristic, and the exact error conditions. This is the kind of quality-risk disclosure an agent needs before compressing important documents.

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?

Five dense sentences that each earn their place: mechanism, risk, losses, per-page logic, error cases. The core purpose and the smallest/lossless comparison are front-loaded with no filler.

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?

No output schema exists, and the description covers risks, page heuristics, and errors thoroughly, but it never states what is returned (e.g., base64 PDF payload, filename, size). That single omission keeps it from being fully complete for invoking and handling the result.

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% and the schema already explains dpi, threshold (including 'higher is safer and slightly larger'), and fileBase64 limits. The description adds no parameter-level detail beyond what the schema provides, so baseline 3 applies.

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 scanned PDF') and pinpoints the variant: 'smallest black-and-white file' using JBIG2 symbol mode. The '3x smaller than the lossless black-and-white file' comparison cleanly separates it from siblings like pdf_compress_lossless_bw and pdf_compress_greyscale.

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?

The niche is clear: scanned PDFs where the smallest black-and-white output is wanted and colour/selectable text are expendable. It implicitly points to the lossless black-and-white alternative via the size comparison, but never says explicitly when to choose that sibling over this one, so routing still requires inference.

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