{
  "id": "markdown.to_pdf",
  "object": "tool",
  "name": "Markdown to PDF",
  "summary": "Clean, typeset PDFs from Markdown.",
  "description": "Typesets Markdown (GitHub flavour: tables, task lists, code blocks) as a clean PDF with system fonts. Start a new page with a line containing only ---pagebreak---. Optional title, header and footer.",
  "category": "documents",
  "hosted_by": "Opentools",
  "runtime": "browser",
  "side_effects": false,
  "status": "live",
  "credits": 2,
  "price": "$0.0020",
  "providers": [
    {
      "id": "opentools",
      "name": "Opentools",
      "price": "$0.0020"
    }
  ],
  "mcp_name": "markdown_to_pdf",
  "input_schema": {
    "type": "object",
    "properties": {
      "markdown": {
        "description": "The Markdown",
        "type": "string",
        "minLength": 1,
        "maxLength": 5000000
      },
      "file": {
        "description": "Or a .md file",
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "Public http(s) URL of the file"
              }
            },
            "required": [
              "url"
            ]
          },
          {
            "type": "object",
            "properties": {
              "file_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                "description": "An id returned by POST /v1/files"
              }
            },
            "required": [
              "file_id"
            ]
          },
          {
            "type": "object",
            "properties": {
              "base64": {
                "type": "string",
                "description": "Base64-encoded file bytes (up to 10 MB)"
              },
              "name": {
                "type": "string",
                "description": "File name, e.g. invoice.pdf"
              },
              "content_type": {
                "type": "string"
              }
            },
            "required": [
              "base64",
              "name"
            ]
          },
          {
            "type": "object",
            "properties": {
              "connection": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "A storage connection id or name (see storage.connections)"
              },
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024,
                "description": "Path of the file in that connection, e.g. reports/q3.pdf"
              }
            },
            "required": [
              "connection",
              "path"
            ]
          }
        ],
        "x-file": true
      },
      "title": {
        "description": "Document title, shown at the top and in the PDF metadata",
        "type": "string",
        "maxLength": 300
      },
      "format": {
        "default": "A4",
        "description": "Paper size",
        "type": "string",
        "enum": [
          "A4",
          "Letter",
          "Legal",
          "A3",
          "A5",
          "Tabloid"
        ]
      },
      "landscape": {
        "default": false,
        "description": "Landscape orientation",
        "type": "boolean"
      },
      "margin": {
        "default": {
          "top": "15mm",
          "right": "15mm",
          "bottom": "15mm",
          "left": "15mm"
        },
        "description": "Page margins",
        "type": "object",
        "properties": {
          "top": {
            "default": "15mm",
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(px|in|cm|mm)$",
            "description": "A length like \"10mm\", \"0.5in\" or \"20px\""
          },
          "right": {
            "default": "15mm",
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(px|in|cm|mm)$",
            "description": "A length like \"10mm\", \"0.5in\" or \"20px\""
          },
          "bottom": {
            "default": "15mm",
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(px|in|cm|mm)$",
            "description": "A length like \"10mm\", \"0.5in\" or \"20px\""
          },
          "left": {
            "default": "15mm",
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(px|in|cm|mm)$",
            "description": "A length like \"10mm\", \"0.5in\" or \"20px\""
          }
        }
      },
      "print_background": {
        "default": true,
        "description": "Print background colours and images",
        "type": "boolean"
      },
      "scale": {
        "default": 1,
        "description": "Rendering scale, 0.1 to 2",
        "type": "number",
        "minimum": 0.1,
        "maximum": 2
      },
      "header_template": {
        "description": "HTML for the page header. Elements with class \"pageNumber\", \"totalPages\", \"title\", \"url\" or \"date\" are filled in. Use inline styles and a font-size.",
        "type": "string",
        "maxLength": 20000
      },
      "footer_template": {
        "description": "HTML for the page footer, same classes as the header",
        "type": "string",
        "maxLength": 20000
      },
      "page_numbers": {
        "default": true,
        "description": "Add a \"Page X of Y\" footer when no footer template is given",
        "type": "boolean"
      },
      "page_ranges": {
        "description": "Pages to print, like \"1-3, 5\". All if omitted.",
        "type": "string",
        "maxLength": 200
      },
      "media": {
        "default": "print",
        "description": "CSS media type to render with",
        "type": "string",
        "enum": [
          "print",
          "screen"
        ]
      },
      "name": {
        "default": "document.pdf",
        "description": "Name of the output file",
        "type": "string",
        "maxLength": 120
      }
    }
  },
  "kind": "tool"
}