Skip to main content
Glama

PDF Crop API - trim margins automatically or by millimetres

pdf_crop
Read-onlyIdempotent

Cut white margins off every page automatically, or crop top/bottom/left/right by millimetres. 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-crop.

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": {
      "mode": "auto",
      "fileName": "sample.pdf",
      "fileContent": "JVBERi0xLjMKJenr8b8KMSAwIG9iago8PAovQ291bnQgMQovS2lkcyBbMyAwIFJdCi9NZWRpYUJveCBbMCAwIDU5NS4yOCA4NDEuODldCi9UeXBlIC9QYWdlcwo+PgplbmRvYmoKMiAwIG9iago8PAovT3BlbkFjdGlvbiBbMyAwIFIgL0ZpdEggbnVsbF0KL1BhZ2VMYXlvdXQgL09uZUNvbHVtbgovUGFnZXMgMSAwIFIKL1R5cGUgL0NhdGFsb2cKPj4KZW5kb2JqCjMgMCBvYmoKPDwKL0NvbnRlbnRzIDQgMCBSCi9QYXJlbnQgMSAwIFIKL1Jlc291cmNlcyA2IDAgUgovVHlwZSAvUGFnZQo+PgplbmRvYmoKNCAwIG9iago8PAovRmlsdGVyIC9GbGF0ZURlY29kZQovTGVuZ3RoIDExMgo+PgpzdHJlYW0KeJwzUvDiMtAzNVco53IKUdB3M1QwNNIzMFAISVNwDQEJGRvqGVoomFua6pmbK4SkKGh45pXlZyanKhgZGJnpGhgYKrhWJOYW5KQq+JSkaCqEZKHqMzPXMzEC6wvJL0nMAZpuADLeNTQIphYAsdgfAQplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKPDwKL0Jhc2VGb250IC9IZWx2ZXRpY2EKL0VuY29kaW5nIC9XaW5BbnNpRW5jb2RpbmcKL1N1YnR5cGUgL1R5cGUxCi9UeXBlIC9Gb250Cj4+CmVuZG9iago2IDAgb2JqCjw8Ci9Gb250IDw8L0YxIDUgMCBSPj4KL1Byb2NTZXQgWy9QREYgL1RleHQgL0ltYWdlQiAvSW1hZ2VDIC9JbWFnZUldCj4+CmVuZG9iago3IDAgb2JqCjw8Ci9DcmVhdGlvbkRhdGUgKEQ6MjAyNjExMTUyMDEzNTRaKQo+PgplbmRvYmoKeHJlZgowIDgKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAxMDIgMDAwMDAgbiAKMDAwMDAwMDIwNSAwMDAwMCBuIAowMDAwMDAwMjg1IDAwMDAwIG4gCjAwMDAwMDA0NjkgMDAwMDAgbiAKMDAwMDAwMDU2NiAwMDAwMCBuIAowMDAwMDAwNjUzIDAwMDAwIG4gCnRyYWlsZXIKPDwKL1NpemUgOAovUm9vdCAyIDAgUgovSW5mbyA3IDAgUgovSUQgWzwyMzc0NENDOUY1ODJDN0FCMkFGMjQ5MDVFRTQ3RjgzNz48MjM3NDRDQzlGNTgyQzdBQjJBRjI0OTA1RUU0N0Y4Mzc+XQo+PgpzdGFydHhyZWYKNzA4CiUlRU9GCg=="
    },
    "name": "pdf_crop"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNoTop mm (mode=mm)
leftNoLeft mm (mode=mm)
modeNoauto (detect margins) or mm (your values)auto
filesNoOr several files: [{fileName, fileContent (base64)}]
rightNoRight mm (mode=mm)
bottomNoBottom mm (mode=mm)
fileNameNoFile name with extension, e.g. report.pdf
fileContentNoThe file as base64 (a data: URI is fine)
sameOnAllPagesNoUse one crop box for every page (mode=auto)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint, so the safety profile is covered; the description adds real value beyond that with server-side execution, immediate file deletion ('files are deleted right after the call, nothing stored'), a free tier of 25 calls/day per IP and a paid tier at $0.005 per call via x402. These privacy, quota and pricing facts are exactly the kind of context annotations cannot express. It stops short of describing what the call returns or any size limits.

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?

Two tight sentences then a commercial/operational footer, with the core action front-loaded and no filler. The compressed phrasing ('Cut white margins off', 'Free: 25 calls/day per IP') is efficient rather than confusing, though the pricing sentence is dense enough to slow reading.

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?

For a 9-parameter file-transformation tool with no output schema, the description omits what the caller receives back (base64 PDF, URL, or binary) and never mentions the multi-file 'files' path. Privacy, rate limits and pricing are covered well, but the return-value gap is material when no output schema exists.

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 every parameter is already documented, and the description only echoes the mode distinction that the enum description already supplies. It says nothing about the 'files' array for batch input or 'sameOnAllPages', which are the semantically non-obvious parameters. Baseline 3 is appropriate since the schema carries the load.

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?

States a specific verb and resource ('Cut white margins off every page', 'crop top/bottom/left/right by millimetres') and names the two operating modes, so the agent knows exactly what PDF operation this is. It does not explicitly differentiate itself from the sibling image_crop, which handles the analogous job for a different file type.

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?

The description distinguishes the two modes (automatic margin detection vs explicit millimetre values), giving implied selection guidance, but this largely mirrors the schema enum text. It never states when to prefer this over alternatives such as pdf_compress or image_crop, nor any file-size/page-count preconditions.

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