Skip to main content
Glama

Fix document margins

fix_document_margins
DestructiveIdempotent

Use this when an uploaded PDF fails the print check because content is too close to the edge or pages are neither A4 nor US Letter. mode "shrink" (default) scales the affected pages down slightly and centres them on their paper (US Letter for a US Letter PDF, else A4); nothing is lost. mode "crop" keeps pages at 100 % and removes everything inside the margin band, so that content is NOT printed (pages of other sizes are first fitted onto A4). The US Letter pages of a mixed PDF that already fit on A4 keep their placement. The original upload is kept; calling again with the other mode replaces the earlier fix. If content touches the edge, ask the user which mode they prefer and tell them what changed. Not possible once the letter is paid. Needs the user's account.

Input Schema

NameRequiredDescriptionDefault
modeNo"shrink" = scale pages down slightly, nothing lost; "crop" = keep 100 % size and cut off everything inside the margin (that content is not printed). Default "shrink".shrink
document_idYesdocument_id returned by upload_document or compose_letter, e.g. doc_2h7k9m4q8x1v3c6b0n5p.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / document_id / description
      Added value: +"document_id returned by upload_document or compose_letter, e.g. doc_2h7k9m4q8x1v3c6b0n5p."
    • changedInput schema / properties / mode / description
      Previous value: -"shrink = scale pages down slightly, nothing lost; crop = keep 100 % size and cut off everything inside the margin (that content is not printed)"New value: +"\"shrink\" = scale pages down slightly, nothing lost; \"crop\" = keep 100 % size and cut off everything inside the margin (that content is not printed). Default \"shrink\"."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and idempotentHint=true, and the description goes well beyond them: crop 'removes everything inside the margin band, so that content is NOT printed', the original upload is kept, and re-calling with the other mode replaces the earlier fix. It also discloses a lifecycle constraint not in annotations (fails once the letter is paid), which is exactly the kind of context the agent needs before invoking a destructive fix.

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?

Front-loaded with the triggering condition and mode semantics, and each sentence carries a distinct constraint (destruction, reversibility, lifecycle, escalation). It is dense — several clauses packed into long sentences — but no sentence is filler.

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 destructive, non-read-only operation with no output schema, the description covers what gets removed, what is preserved, reversibility, the paid-letter precondition, and the auth requirement. Nothing an agent needs to call this correctly appears to be missing.

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% and the mode enum is already fully documented in the schema, so the baseline is 3. The description earns extra credit by adding behaviour the schema does not: how shrink centres pages ('US Letter for a US Letter PDF, else A4') and how mixed PDFs that already fit on A4 keep their placement.

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 (fix) and resource (document margins) and pins the exact trigger condition: an uploaded PDF that fails the print check because content is too close to the edge or pages are not A4/US Letter. This distinguishes it from check_pdf_margins (the diagnostic) without opening either schema.

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?

Explicit when-to-use (print check failure), when-not-to-use (not possible once the letter is paid), and an escalation rule (ask the user which mode they prefer when content touches the edge). It also specifies the precondition 'Needs the user's account', leaving little to 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.