Skip to main content
Glama
Nizoka

pdfnative-mcp

Sign PDF (RSA / ECDSA, PAdES)

sign_pdf

Digitally sign PDFs with PAdES-compatible CMS signatures using RSA-SHA256 or ECDSA-SHA256. Supports auto-injection of signature placeholders for single-call signing.

Instructions

Apply a PAdES-compatible CMS digital signature to a PDF. Since v1.0.0 you can sign ANY PDF in ONE call — autoInjectPlaceholder defaults to true, so you do NOT need to run prepare_signature_placeholder first unless you want to customize the placeholder appearance. Supports RSA-SHA256 and ECDSA-SHA256 (P-256). Required inputs: pdfBase64, algorithm, certDerBase64, plus EITHER rsaKeyPkcs1DerBase64 (when algorithm='rsa-sha256') OR ecPrivateScalarHex / ecPrivateKeyDerBase64 (when algorithm='ecdsa-sha256'). To convert PEM keys to DER base64: openssl pkey -in key.pem -outform DER | base64 -w0. To convert a PEM X.509 cert: openssl x509 -in cert.pem -outform DER | base64 -w0. After signing, call verify_pdf to confirm validity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pdfBase64YesBase64-encoded PDF bytes. When the PDF already contains a /Sig placeholder it is signed in place; otherwise the placeholder is auto-injected (set autoInjectPlaceholder=false to opt out).
algorithmYesSignature algorithm. ECDSA only supports P-256 in v1.0.0.
certDerBase64YesBase64 of the signer X.509 certificate in DER form. Convert from PEM with: openssl x509 -in cert.pem -outform DER | base64 -w0
rsaKeyPkcs1DerBase64NoBase64 of the RSA private key in PKCS#1 RSAPrivateKey DER (NOT PKCS#8, NOT PEM). Required when algorithm=rsa-sha256. Convert from PEM with: openssl rsa -in key.pem -outform DER -traditional | base64 -w0 (the -traditional flag forces PKCS#1).
ecPrivateScalarHexNoHex-encoded P-256 private scalar `d` (exactly 64 lowercase or uppercase hex chars, no 0x prefix). Mutually exclusive with ecPrivateKeyDerBase64; either is accepted for ECDSA.
ecPrivateKeyDerBase64NoBase64 of an ECDSA P-256 private key in SEC1 (RFC 5915) or PKCS#8 (RFC 5208) DER form. Convert from PEM with: openssl pkey -in key.pem -outform DER | base64 -w0 Mutually exclusive with ecPrivateScalarHex.
autoInjectPlaceholderNoWhen true (default) and the input PDF has no /Sig widget, pdfnative.addSignaturePlaceholder is called before signing — enabling single-call signing of any PDF.
signerNameNo
reasonNo
locationNo
contactInfoNo
signingTimeNoISO-8601 timestamp. Defaults to now.
outputModeNobase64
outputPathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
sizeBytesYes
filePathNoAbsolute sandboxed file path (when mode='file').
base64NoBase64-encoded PDF bytes (when mode='base64').
Behavior4/5

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

Annotations are minimal (all false), so the description carries the burden. It discloses the auto-injection behavior, algorithm support, and conditional key requirements. However, it does not mention potential side effects (e.g., whether the PDF is modified in-place or what happens if the PDF is already signed). The description is mostly transparent but misses some behavioral details.

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 is succinct with no redundant information. It front-loads the primary action, then provides updates, requirements, conversion tips, and a follow-up suggestion. Every sentence adds value.

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?

Given the complexity (14 parameters, 3 required, output schema present), the description covers the essential flow and key requirements. It lacks guidance on optional metadata parameters, but those are less critical. An output schema exists, so return values need not be detailed. Overall, it is fairly complete for most use cases.

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?

The description adds significant meaning for the core parameters (pdfBase64, algorithm, certDerBase64, and the conditional key parameters) and explains the autoInjectPlaceholder default. However, it does not describe optional parameters like signerName, reason, location, contactInfo, signingTime, outputMode, or outputPath, which are only partially covered in the schema (57% coverage). The description could compensate more for the missing schema 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 clearly states the tool applies a PAdES-compatible CMS digital signature to a PDF. It distinguishes from sibling tool prepare_signature_placeholder by explaining that auto-injection renders that step optional. The specific resource (PDF) and action (sign) are evident.

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 explicitly says when to use this tool (to sign any PDF in one call) and when not to (if you want to customize placeholder appearance, use prepare_signature_placeholder). It also recommends calling verify_pdf after signing. Conversion commands for keys are provided, guiding the agent on required input preparation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Nizoka/pdfnative-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server