magic_convert_pdf
Convert flat, unstructured legacy PDF invoices into compliant ZUGFeRD 2.5 PDF/A-3b files via guarded AI extraction with deterministic math and IBAN checks.
Instructions
Convert a flat, unstructured legacy PDF invoice (max 5 pages) into a compliant ZUGFeRD 2.5 PDF/A-3b using guarded AI extraction verified by deterministic BigDecimal math and ISO 13616 MOD-97 IBAN checks. Use ONLY when you have a flat PDF and no structured JSON; prefer embed_zugferd_pdf when structured JSON is available, or generate_erechnung when creating an invoice from scratch. Returns JSON with format ('ZUGFERD'), profile, filename, mimeType ('application/pdf'), sizeBytes, and pdfBase64 (or an actionable validation error if math/IBAN guardrails fail).
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": {
"pdfBase64": "<pdfBase64>"
},
"name": "magic_convert_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Compliance profile: 'EN16931' for standard German B2B invoices (DATEV ZUGFeRD 2.5 Comfort), or 'XRECHNUNG' for strict KoSIT XRechnung 3.0.2 public-sector rules (requires buyerReference, seller email/phone, buyer email). | EN16931 |
| pdfBase64 | Yes | Base64-encoded flat legacy PDF invoice (1 to 5 pages) to extract and convert into ZUGFeRD 2.5 PDF/A-3b. | |
| stampGiroCode | No | When true, stamps a scannable EPC SEPA GiroCode QR code onto the visual ZUGFeRD PDF using seller.bankDetails[0].iban. |