{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF MCP Server",
    "description": "Stateless PDF tools exposed via MCP.\nOpen, split, merge, extract text, fill and flatten forms, and generate PDFs in a single run. Designed for deterministic, auditable document transformations by agents and workflows.",
    "version": "1.1",
    "x-build-id": "HeFHcBr9KaCbYYbup"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/constant_quadruped~pdf-mcp-server/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-constant_quadruped-pdf-mcp-server",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/constant_quadruped~pdf-mcp-server/runs": {
      "post": {
        "operationId": "runs-sync-constant_quadruped-pdf-mcp-server",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/constant_quadruped~pdf-mcp-server/run-sync": {
      "post": {
        "operationId": "run-sync-constant_quadruped-pdf-mcp-server",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "tool": {
            "title": "Tool",
            "enum": [
              "pdf.open",
              "pdf.get_metadata",
              "pdf.render_pages",
              "pdf.extract_text",
              "pdf.list_form_fields",
              "pdf.fill_form_fields",
              "pdf.flatten_form",
              "pdf.create_from_html",
              "pdf.merge",
              "pdf.split",
              "pdf.extract_pages",
              "pdf.ai_extract"
            ],
            "type": "string",
            "description": "Tool to execute"
          },
          "pdfUrl": {
            "title": "PDF URL",
            "type": "string",
            "description": "URL of the PDF to process"
          },
          "pdfBase64": {
            "title": "PDF Base64",
            "type": "string",
            "description": "Base64 encoded PDF (alternative to URL)"
          },
          "documentType": {
            "title": "Document Type (for AI Extract)",
            "enum": [
              "auto",
              "invoice",
              "receipt",
              "contract",
              "resume",
              "w2",
              "form_1099",
              "bank_statement"
            ],
            "type": "string",
            "description": "Type of document to extract",
            "default": "auto"
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "Your OpenAI API key (required for pdf.ai_extract)"
          },
          "openaiModel": {
            "title": "OpenAI Model",
            "enum": [
              "gpt-4o",
              "gpt-4o-mini",
              "gpt-4-turbo"
            ],
            "type": "string",
            "description": "OpenAI model to use for extraction",
            "default": "gpt-4o"
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Pages to process (e.g., '1,2,3' or 'all')"
          },
          "formFields": {
            "title": "Form Fields (JSON)",
            "type": "string",
            "description": "JSON object with field names and values for pdf.fill_form_fields"
          },
          "customFields": {
            "title": "Custom Fields (JSON)",
            "type": "string",
            "description": "Custom extraction schema for pdf.ai_extract"
          },
          "html": {
            "title": "HTML Content",
            "type": "string",
            "description": "HTML content for pdf.create_from_html"
          },
          "htmlUrl": {
            "title": "HTML URL",
            "type": "string",
            "description": "URL to convert to PDF"
          },
          "urls": {
            "title": "PDF URLs (for merge)",
            "type": "string",
            "description": "JSON array of PDF URLs to merge"
          },
          "ranges": {
            "title": "Page Ranges (for split)",
            "type": "string",
            "description": "JSON array of page ranges, e.g., [{\"start\":1,\"end\":5},{\"start\":6,\"end\":10}]"
          },
          "renderDpi": {
            "title": "Render DPI",
            "type": "integer",
            "description": "DPI for page rendering",
            "default": 150
          },
          "renderFormat": {
            "title": "Render Format",
            "enum": [
              "png",
              "jpeg"
            ],
            "type": "string",
            "description": "Output format for rendered pages",
            "default": "png"
          },
          "pdfFormat": {
            "title": "PDF Format",
            "enum": [
              "A4",
              "Letter",
              "Legal"
            ],
            "type": "string",
            "description": "Page format for PDF creation",
            "default": "A4"
          },
          "includeConfidence": {
            "title": "Include Confidence Scores",
            "type": "boolean",
            "description": "Include per-field confidence scores in AI extraction",
            "default": true
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}