{
  "name": "doc.extract",
  "group": "doc",
  "summary": "Extract the text of a PDF, Word, Excel or other document as markdown or plain text.",
  "description": "Converts a document to markdown or plain text: pass a public URL or the file itself as base64, and get back the content with headings, tables and lists preserved, at a fraction of the tokens that rendered pages cost. Use it when a harness has no native reader for the format — .docx, .xlsx, .odt and .numbers rarely have one — when a document is only a URL away, or when a long PDF's text matters and its layout does not. Handles PDF (.pdf), Word (.docx), Excel (.xlsx, .xlsm, .xlsb, .xls), OpenDocument (.odt, .ods), Apple Numbers, CSV, HTML, XML, and plain-text formats such as .txt and .md. The format is detected from magic bytes, not trusted from the file name, so a PDF served from a .php URL still converts. Two honest limits: a scanned PDF with no text layer has nothing to extract (this is conversion, not OCR), and legacy binary .doc and .ppt files are not readable — resave them as .docx or .pptx. Images are refused rather than described. Documents up to 10 MB.",
  "keywords": [
    "pdf to text",
    "extract text from pdf",
    "word to text",
    "docx to text",
    "pdf to markdown",
    "docx to markdown",
    "excel to text",
    "xlsx to markdown",
    "read pdf",
    "parse docx",
    "convert document",
    "document extraction",
    "spreadsheet to text",
    "html to markdown",
    "odt",
    "file to text"
  ],
  "endpoint": "https://fluentedi.com/v1/doc/extract",
  "mcp_name": "doc_extract",
  "makes_network_request": true,
  "parameters": {
    "type": "object",
    "properties": {
      "url": {
        "description": "Public URL of the document to fetch and convert.",
        "type": "string",
        "maxLength": 4000,
        "examples": [
          "https://arxiv.org/pdf/1706.03762"
        ]
      },
      "base64": {
        "description": "The file content as base64 (or a data: URI) instead of a URL, for documents not publicly reachable. Up to 10 MB decoded.",
        "type": "string",
        "default": "",
        "maxLength": 14000000
      },
      "filename": {
        "description": "Original file name, e.g. \"report.docx\". Only needed when the format cannot be detected from the URL or the bytes.",
        "type": "string",
        "default": "",
        "maxLength": 300
      },
      "format": {
        "description": "Output style: markdown keeps headings, tables and lists; text strips them.",
        "type": "string",
        "enum": [
          "markdown",
          "text"
        ],
        "default": "markdown"
      },
      "max_chars": {
        "description": "Truncate the extracted content beyond this many characters.",
        "type": "integer",
        "default": 200000,
        "minimum": 100,
        "maximum": 2000000
      },
      "timeout_ms": {
        "description": "Fetch timeout in milliseconds when url is used.",
        "type": "integer",
        "default": 15000,
        "minimum": 1000,
        "maximum": 30000
      }
    },
    "required": [],
    "additionalProperties": false
  },
  "examples": [
    {
      "description": "Extract a PDF paper as markdown",
      "url": "https://fluentedi.com/v1/doc/extract?url=https%3A%2F%2Farxiv.org%2Fpdf%2F1706.03762",
      "args": {
        "url": "https://arxiv.org/pdf/1706.03762"
      }
    },
    {
      "description": "Word document to markdown",
      "url": "https://fluentedi.com/v1/doc/extract?url=https%3A%2F%2Fcalibre-ebook.com%2Fdownloads%2Fdemos%2Fdemo.docx",
      "args": {
        "url": "https://calibre-ebook.com/downloads/demos/demo.docx"
      }
    },
    {
      "description": "A web page as plain text",
      "url": "https://fluentedi.com/v1/doc/extract?url=https%3A%2F%2Fexample.com%2F&format=text",
      "args": {
        "url": "https://example.com/",
        "format": "text"
      }
    }
  ],
  "suggestion": null
}