Skip to main content
Glama
PDF.co MCP Server

PDF.co MCP Server

Official
by pdfdotco

PDF to e-invoice

pdf_to_e_invoice

Embeds invoice XML into a PDF, converts it to PDF/A-3, and validates the result to produce a Factur-X or ZUGFeRD e-invoice.

Instructions

Create a Factur-X or ZUGFeRD e-invoice by embedding invoice XML into a PDF, converting it to PDF/A-3 and validating it with veraPDF and Mustang. The job always runs in the background: this returns a job ID, and the result comes from 'wait_job_completion'. An e-invoice that fails validation ends as a failed job and the charge is refunded; validationReportUrl in the result explains why. Ref: https://developer.pdf.co/api/pdf-to-e-invoice.md

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": {
      "url": "<url>",
      "xml_url": "<xml_url>",
      "profile": "<profile>"
    },
    "name": "pdf_to_e_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesURL to the source PDF file. Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files.
nameNoFile name for the output PDF. (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)
profileYesInvoice profile family: 'facturx' (Factur-X) or 'zugferd' (ZUGFeRD).
xml_urlYesURL to the invoice XML (CrossIndustryInvoice) to embed. Use a public or temporary presigned URL; the HTTP auth inputs do not apply to it. The XML decides the conformance level (MINIMUM, BASIC WL, BASIC, EN16931 or EXTENDED).
expirationNoLifetime of the output and report links in minutes; the files are deleted afterwards. API default is 60. (Optional)
httppasswordNoHTTP auth password for the source PDF URL only. (Optional)
httpusernameNoHTTP auth user name for the source PDF URL only. (Optional)

Output Schema

NameRequiredDescriptionDefault
tipsNo
statusYes
contentYes
credits_usedNo
credits_remainingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.12

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnly=false, destructive=false) by disclosing the asynchronous job model, the failure semantics (validation failure ends as a failed job), the refund policy, and where the diagnostic lives (validationReportUrl). That is exactly the behavioral context an agent needs before calling.

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 core action, followed by the async contract, the failure/refund behavior, and a reference link; every sentence carries information. The prose is dense but not padded.

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?

Output schema exists, so return values need not be spelled out, yet the description still points to validationReportUrl for failures. Combined with the async contract and full schema coverage, nothing an agent needs to invoke this correctly is missing.

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 description coverage is 100%, so all eight parameters are already well documented, including the fact that the XML determines the conformance level. The description adds no parameter-level meaning beyond the schema, so the 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 ('Create a Factur-X or ZUGFeRD e-invoice') and enumerates the distinct operations performed (XML embedding, PDF/A-3 conversion, veraPDF/Mustang validation). This clearly separates it from the sibling pdf_to_pdfa, which only converts to PDF/A.

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?

Explicitly tells the agent that the job always runs in the background and that the result must be retrieved via 'wait_job_completion', which is actionable workflow guidance. It does not, however, state when an agent should prefer pdf_to_pdfa or plain validation instead, so exclusions are missing.

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