Skip to main content
Glama
Nizoka

pdfnative-mcp

Prepare signature placeholder

prepare_signature_placeholder
Idempotent

Prepare a PDF with an unsigned signature placeholder for later signing, letting you reserve placeholder bytes, choose the signature subfilter, and freeze signer parameters before the signing call.

Instructions

New PDF carrying an unsigned /Sig placeholder for a LATER sign_pdf call. OPTIONAL — sign_pdf auto-injects one. Use it to size the placeholder (placeholderBytes for > 4096-bit keys, reserveTimestamp for an RFC 3161 token), to pin the widget page (pageIndex), to choose subFilter 'ETSI.CAdES.detached' (PAdES), or to ship the placeholder separately. signerName/reason/location/contactInfo/signingTime are frozen into /Sig here — sign_pdf cannot rewrite them later. NOTE: the unsigned file is not yet a conformant PDF/A (empty /Contents); it becomes one once signed. PDF/A, print, metadata and creationDate options as on every document tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pdfANoPDF/A level: pdfa1b (simple text+images), pdfa2b/pdfa2u (richer; 2u = Unicode mapping), pdfa3b (attachments / Factur-X). Pair with embedFonts=true for a valid claim. Exclusive with encryption. See docs/guides/PDFA.md. The unsigned placeholder is NOT yet conformant (empty /Contents, ISO 19005-2 §6.4.3); it is once signed with sign_pdf profile:'pades'.
debugNoDraw margin / block / cell guide rectangles (unmarked content — not for PDF/UA output). Geometry unchanged. Default false.
printNoPrint production (ISO 32000-1 §14.11): page boxes, `bleed` shorthand (TrimBox = MediaBox inset), crop/registration marks outside the TrimBox, /UserUnit for large formats (PDF 1.7; not under pdfa1b). See docs/guides/PRINT.md.
titleYesDocument title. Used as the PDF metadata title and rendered at the top of page 1.
blocksNoOptional document body blocks rendered before the signature field.
reasonNoReason for signing (e.g. "Approved", "I agree to the terms").
strictNoFail with PDF_A_COMPLIANCE_VIOLATION instead of producing a non-conformant PDF/A file (e.g. PDFA_NO_FONT_ENTRIES without embedFonts). Pair with embedFonts=true.
marginsNoMargins in points, all four required (0–200). Default 45 / 36 / 35 / 36.
compressNoFlateDecode the streams (smaller file, different bytes; PDF/A unaffected, XMP stays plain). Default false.
locationNoSigning location (city / country).
metadataNo/Info (+ XMP under PDF/A): author, subject, keywords, /Trapped.
pageSizeNoPortrait page preset (points): A4 595.28×841.89 (default), Letter 612×792, Legal 612×1008, A3 841.89×1190.55, Tabloid 792×1224. print.* boxes must fit it.
fieldNameNoOptional AcroForm field name for the signature widget (default 'Signature1').
pageIndexNoZero-based page index the (invisible) widget attaches to (default 0).
subFilterNoSignature SubFilter baked into the /Sig dictionary (frozen at placeholder time). Use 'ETSI.CAdES.detached' for PAdES baseline signatures (sign_pdf profile='pades'). Default 'adbe.pkcs7.detached'.
embedFontsNoEmbed Noto Sans Latin instead of the viewer base-14 Helvetica. REQUIRED for a valid PDF/A claim (ISO 19005 §6.2.11.4.1) and for strict=true; adds ~0.3 MiB.
outputModeNoEither 'base64' (returns the PDF inline) or 'file' (writes to a sandboxed path inside PDFNATIVE_MCP_OUTPUT_DIR).base64
outputPathNoRequired when outputMode='file'. Relative path inside the sandbox; must end with .pdf.
signerNameNoName of the intended signer, embedded in the /Sig dictionary.
contactInfoNoContact information for the signer.
signingTimeNo/Sig /M — the claimed signing instant (ISO-8601), frozen into the placeholder dictionary. Omitted: the wall clock at placeholder time. Pin it (with creationDate) for byte-identical output across calls.
creationDateNoISO-8601 instant for /CreationDate (+ XMP). Pin it for byte-identical output across calls (same host TZ); omitted = wall clock, so every call differs.
outputIntentNoCustom PDF/A OutputIntent: an RGB ICC profile + condition strings replacing the built-in sRGB intent (CMYK rejected).
footerTemplateNoRunning footer on every page. Replaces the default footer: footerText is then ignored and page numbers appear only via {page}/{pages}.
headerTemplateNoRunning header on every page (left / center / right zones); reserves 15 pt.
placeholderBytesNoReserved bytes for the future CMS /Contents blob (default 16384; 24576 when reserveTimestamp=true). Increase only for >4096-bit RSA, long chains or large TSA tokens.
reserveTimestampNoReserve room for an RFC 3161 signature timestamp (sign_pdf timestamp=true): adds 8 KiB to the default placeholder size. Ignored when placeholderBytes is set explicitly.
includeDiagnosticsNoReturn the PDF/A diagnostics raised while building as `diagnostics[]` (possibly empty).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
summaryNoTool-specific summary, when produced.
filePathNoSandboxed absolute path (file mode).
sizeBytesYes
diagnosticsNoPDF/A diagnostics (when includeDiagnostics=true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removedv1.6.0
  3. Changed2 schema fields changedv1.2.0
    • addedOutput schema / description
      Added value: +"Structured result of a PDF-producing tool. In base64 mode the PDF bytes are delivered out-of-band as an embedded `resource` content block (data: URI), NOT duplicated here, to keep responses token-frugal. In file mode `filePath` is the sandboxed absolute path."
    • removedOutput schema / properties / base64
      Removed value: -{
      -  "description": "Base64-encoded PDF bytes (when mode='base64').",
      -  "type": "string"
      -}
  4. First observedv1.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations declare idempotentHint=true and destructiveHint=false, so no contradiction. The description adds genuine behavior beyond those: the unsigned file is NOT yet a conformant PDF/A (empty /Contents) and becomes conformant only once signed; signature metadata is frozen at placeholder time and can't be rewritten by sign_pdf later. It also discloses the 'auto-inject' behavior of the sibling, which is a non-obvious interaction an agent needs to predict placeholder sizing.

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?

The description front-loads the core purpose in the first sentence, packs the key behavioral gap (PDF/A non-conformance) in one sentence, and closes with a short cross-tool invariant sentence. The parameter differentiation is compressed into one sentence with a parallel list. No filler, no repetition of schema content.

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?

With 28 parameters, 100% schema coverage, nested objects and an output schema present, the description's job is mostly to disambiguate the tool within the sibling family and call out cross-parameter interactions, both of which it does well. The gap: the description lacks a compact example payload and does not define a concrete 'how to produce a good placeholder for a >4096-bit key' recipe. The schema and output schema carry a large portion of the load, so this is adequate-but-not-complete for such a large tool signature.

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 description coverage is 100%, so baseline is 3 per the rubric. The description earns an extra point by explaining the cross-parameter interaction: placeholderBytes default context, reserveTimestamp adds 8 KiB, and reserveTimestamp is ignored when placeholderBytes is set explicitly. It also links subFilter to the sign_pdf profile='pades' and pageIndex to a latent widget. This is real semantic value beyond the schema's per-field descriptions.

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?

The description opens with a specific verb-plus-resource statement: 'New PDF carrying an unsigned /Sig placeholder for a LATER sign_pdf call.' It clearly distinguishes the tool from sign_pdf by framing this as the placeholder preparation step, and it names the sibling sign_pdf explicitly in the first sentence. The scope (what gets frozen, what can be resized) is specific rather than vague.

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 states when to use this tool and, crucially, when NOT to: 'OPTIONAL — sign_pdf auto-injects one.' The description enumerates concrete use cases (reserve space for >4096-bit keys, pin widget page, choose PAdES subFilter, ship placeholder separately). It also warns that signerName/reason/location/contactInfo/signingTime are frozen here and cannot be rewritten by sign_pdf later, giving the agent a clear decision rule between this tool and its sibling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.