{
  "x402Version": 2,
  "service": "pdf-forge",
  "title": "PDF Forge & Layout Diagnostics Edge API",
  "version": "1.0.0",
  "mcpEndpoint": "https://pdf-forge.apikeg.com/mcp",
  "freeDiscovery": [
    "https://pdf-forge.apikeg.com/llms.txt",
    "https://pdf-forge.apikeg.com/llms-full.txt",
    "https://pdf-forge.apikeg.com/openapi.json",
    "https://pdf-forge.apikeg.com/.well-known/mcp.json",
    "https://pdf-forge.apikeg.com/.well-known/api-catalog"
  ],
  "resources": [
    {
      "name": "render_document_pdf",
      "title": "Render Markdown or HTML Document to Themed PDF",
      "url": "https://pdf-forge.apikeg.com/v1/render-document-pdf",
      "method": "POST",
      "description": "Compiles Markdown (headings, bold/italic/code, lists, GFM tables, callouts, '---pagebreak---') or HTML into both print-ready themed HTML and a spec-compliant multi-page PDF 1.7 binary with running headers, 'Page X of Y' footers, repeated table headers across page breaks, optional watermark, and deterministic layoutDiagnostics. Why call instead of DIY: Avoids spinning up 400MB Puppeteer/Playwright containers or hand-rolling brittle PDF stream/xref math; returns both binary PDF and layout QA diagnostics in <20ms at $0.004. Pricing: $0.004 USD per rendered PDF document (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "4000",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.004",
            "unitDescription": "per rendered PDF document",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "document-generation",
            "reporting",
            "business-ops",
            "developer-tools"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "title": "Q4 Cloud FinOps Executive Summary",
                "subtitle": "Quarterly Infrastructure Margin & Savings Audit",
                "author": "Platform FinOps Team",
                "theme": "executive",
                "pageSize": "Letter",
                "orientation": "portrait",
                "contentFormat": "markdown",
                "headerText": "ACME CORP — Q4 FINOPS AUDIT",
                "includePageNumbers": true,
                "watermarkText": "CONFIDENTIAL",
                "content": "## Highlights\n\nNet cloud margin improved **420 bps** quarter-over-quarter.\n\n| Service | Q3 Spend | Q4 Spend | Delta |\n| --- | ---: | ---: | ---: |\n| Compute | $142,000 | $118,500 | -16.5% |\n| Storage | $38,400 | $35,100 | -8.6% |\n\n> [!NOTE]\n> Reserved capacity commitments lock in an additional $95k annualized savings."
              }
            },
            "output": {
              "type": "json",
              "summary": "Base64 PDF 1.7 binary, print-ready themed HTML, byteLength, and layoutDiagnostics (pageCount, lastPageFillRatio, wideTableWarnings, estimatedReadingMinutes)."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 524288,
                  "description": "Markdown (headings, bold/italic/code, lists, GFM tables, callouts, '---pagebreak---') or raw HTML body to compile."
                },
                "contentFormat": {
                  "type": "string",
                  "enum": [
                    "markdown",
                    "html"
                  ],
                  "default": "markdown",
                  "description": "Input syntax format ('markdown' or 'html')."
                },
                "title": {
                  "type": "string",
                  "maxLength": 240,
                  "description": "Optional document title rendered in the cover banner and stored in PDF /Title metadata."
                },
                "subtitle": {
                  "type": "string",
                  "maxLength": 320,
                  "description": "Optional subtitle rendered below the title and stored in PDF /Subject metadata."
                },
                "author": {
                  "type": "string",
                  "maxLength": 160,
                  "description": "Optional author or organization name rendered in the cover banner and PDF /Author metadata."
                },
                "theme": {
                  "type": "string",
                  "enum": [
                    "executive",
                    "invoice",
                    "technical",
                    "memo"
                  ],
                  "default": "executive",
                  "description": "Corporate print styling theme ('executive', 'invoice', 'technical', or 'memo')."
                },
                "pageSize": {
                  "type": "string",
                  "enum": [
                    "Letter",
                    "A4",
                    "Legal"
                  ],
                  "default": "Letter",
                  "description": "Paper size ('Letter', 'A4', or 'Legal')."
                },
                "orientation": {
                  "type": "string",
                  "enum": [
                    "portrait",
                    "landscape"
                  ],
                  "default": "portrait",
                  "description": "Page orientation ('portrait' or 'landscape')."
                },
                "headerText": {
                  "type": "string",
                  "maxLength": 180,
                  "description": "Optional running header stamped at the top margin of every page."
                },
                "includePageNumbers": {
                  "type": "boolean",
                  "default": true,
                  "description": "Include 'Page X of Y' running footers on every page."
                },
                "watermarkText": {
                  "type": "string",
                  "maxLength": 80,
                  "description": "Optional diagonal watermark text rendered across every page (e.g. 'CONFIDENTIAL' or 'DRAFT')."
                }
              },
              "required": [
                "content"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "name": "inspect_pdf_document",
      "title": "Inspect Binary PDF Structure & Metadata",
      "url": "https://pdf-forge.apikeg.com/v1/inspect-pdf-document",
      "method": "POST",
      "description": "Parses a Base64-encoded PDF binary to verify %PDF header/EOF integrity and extract pdfVersion, exact pageCount, byteLength, encryption status, AcroForm presence, and Info dictionary metadata. Why call instead of DIY: Instant deterministic PDF preflight without installing native poppler/pdfinfo binaries; $0.001 per check. Pricing: $0.001 USD per PDF binary inspection (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "1000",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.001",
            "unitDescription": "per PDF binary inspection",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "document-generation",
            "reporting",
            "business-ops",
            "developer-tools"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "pdfBase64": "JVBERi0xLjcK..."
              }
            },
            "output": {
              "type": "json",
              "summary": "validPdf=true, pdfVersion='1.7', pageCount, byteLength, encrypted=false, hasAcroForm=false, and metadata."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "pdfBase64": {
                  "type": "string",
                  "minLength": 8,
                  "maxLength": 5242880,
                  "description": "Base64-encoded PDF binary (standard or URL-safe Base64, optional 'data:application/pdf;base64,' prefix)."
                }
              },
              "required": [
                "pdfBase64"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}