{
  "id": "file.convert",
  "object": "tool",
  "name": "Convert any file",
  "summary": "200+ formats, one tool.",
  "description": "Converts a file from one format to another: documents, spreadsheets, slides, e-books, images, vector graphics, CAD (DXF), fonts, audio, video and archives. The source format is read from the file name (or pass from); the engine (LibreOffice, pandoc, ffmpeg, libvips, ImageMagick, Ghostscript, calibre, Inkscape, DuckDB and others) is picked for the pair. Multi-page outputs (PDF to PNG, slides to JPG) come back as one file per page.",
  "category": "files",
  "hosted_by": "Opentools",
  "runtime": "container",
  "side_effects": false,
  "status": "live",
  "credits": 3,
  "price": "$0.0030",
  "providers": [
    {
      "id": "opentools",
      "name": "Opentools",
      "price": "$0.0030"
    }
  ],
  "mcp_name": "file_convert",
  "input_schema": {
    "type": "object",
    "properties": {
      "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,
        "description": "The file to convert"
      },
      "to": {
        "type": "string",
        "enum": [
          "3gp",
          "7z",
          "aac",
          "ac3",
          "aiff",
          "amr",
          "avi",
          "avif",
          "azw3",
          "bmp",
          "caf",
          "csv",
          "doc",
          "docx",
          "emf",
          "eps",
          "epub",
          "fb2",
          "flac",
          "flv",
          "gif",
          "heic",
          "html",
          "htmlz",
          "ico",
          "jpg",
          "json",
          "jxl",
          "lit",
          "lrf",
          "m4a",
          "m4v",
          "md",
          "mka",
          "mkv",
          "mobi",
          "mov",
          "mp3",
          "mp4",
          "mpeg",
          "ndjson",
          "odp",
          "ods",
          "odt",
          "ogg",
          "ogv",
          "opus",
          "otf",
          "parquet",
          "pdb",
          "pdf",
          "png",
          "ppm",
          "ppt",
          "pptx",
          "ps",
          "rst",
          "rtf",
          "snb",
          "svg",
          "tar",
          "tar.bz2",
          "tar.gz",
          "tar.xz",
          "tar.zst",
          "tcr",
          "tex",
          "tga",
          "tiff",
          "ts",
          "tsv",
          "ttf",
          "txt",
          "txtz",
          "wav",
          "weba",
          "webm",
          "webp",
          "wma",
          "wmf",
          "wmv",
          "woff",
          "woff2",
          "xls",
          "xlsx",
          "zip"
        ],
        "description": "Target format id, e.g. pdf, docx, png, mp4, mp3, epub, xlsx, svg, zip"
      },
      "from": {
        "description": "Source format id. Detected from the file name if omitted.",
        "type": "string",
        "enum": [
          "pdf",
          "md",
          "rst",
          "tex",
          "org",
          "textile",
          "ipynb",
          "dbk",
          "opml",
          "wiki",
          "docx",
          "odt",
          "html",
          "epub",
          "doc",
          "docm",
          "dotx",
          "dot",
          "ott",
          "fodt",
          "rtf",
          "txt",
          "wpd",
          "wps",
          "pages",
          "abw",
          "lwp",
          "sxw",
          "csv",
          "tsv",
          "json",
          "ndjson",
          "parquet",
          "xlsx",
          "xls",
          "xlsm",
          "xlsb",
          "ods",
          "ots",
          "fods",
          "numbers",
          "dif",
          "slk",
          "wk1",
          "sxc",
          "pptx",
          "ppt",
          "pptm",
          "ppsx",
          "pps",
          "potx",
          "odp",
          "otp",
          "key",
          "fodp",
          "sxi",
          "mobi",
          "azw3",
          "azw",
          "fb2",
          "lit",
          "lrf",
          "pdb",
          "rb",
          "snb",
          "tcr",
          "txtz",
          "htmlz",
          "pml",
          "cbz",
          "cb7",
          "chm",
          "svg",
          "svgz",
          "eps",
          "ps",
          "ai",
          "cdr",
          "wpg",
          "emf",
          "wmf",
          "vsd",
          "vsdx",
          "odg",
          "pub",
          "cgm",
          "dxf",
          "heic",
          "heif",
          "cr2",
          "crw",
          "nef",
          "arw",
          "dng",
          "orf",
          "rw2",
          "raf",
          "pef",
          "srw",
          "erf",
          "mrw",
          "dcr",
          "3fr",
          "jxl",
          "png",
          "jpg",
          "webp",
          "avif",
          "gif",
          "tiff",
          "jp2",
          "hdr",
          "ppm",
          "pgm",
          "pbm",
          "pnm",
          "bmp",
          "ico",
          "cur",
          "psd",
          "tga",
          "pcx",
          "xpm",
          "xbm",
          "exr",
          "dds",
          "sgi",
          "xcf",
          "pict",
          "miff",
          "dpx",
          "fits",
          "sun",
          "xwd",
          "pam",
          "pfm",
          "wbmp",
          "jng",
          "mng",
          "ttf",
          "otf",
          "woff",
          "woff2",
          "mp3",
          "wav",
          "flac",
          "ogg",
          "opus",
          "m4a",
          "aac",
          "aiff",
          "wma",
          "ac3",
          "amr",
          "mka",
          "weba",
          "caf",
          "au",
          "mp2",
          "wv",
          "ape",
          "dts",
          "spx",
          "tta",
          "mpc",
          "voc",
          "gsm",
          "mp4",
          "m4v",
          "mov",
          "webm",
          "mkv",
          "avi",
          "wmv",
          "asf",
          "flv",
          "f4v",
          "mpeg",
          "ts",
          "mts",
          "3gp",
          "3g2",
          "ogv",
          "vob",
          "mxf",
          "rm",
          "dv",
          "y4m",
          "nut",
          "h264",
          "hevc",
          "zip",
          "7z",
          "rar",
          "tar",
          "tar.gz",
          "tar.bz2",
          "tar.xz",
          "tar.zst",
          "cab",
          "iso",
          "lzh",
          "arj",
          "cpio",
          "jar",
          "sit",
          "xar"
        ]
      },
      "pages": {
        "description": "Pages like \"1-3,5,8-\". All pages if omitted.",
        "type": "string",
        "maxLength": 500,
        "pattern": "^[\\d,\\s-]+$"
      },
      "dpi": {
        "description": "Resolution for PDF/PostScript pages rendered as images",
        "type": "integer",
        "minimum": 36,
        "maximum": 1200
      },
      "quality": {
        "description": "Quality for lossy image outputs, 1-100",
        "type": "integer",
        "minimum": 1,
        "maximum": 100
      },
      "width": {
        "description": "Resize images or video to this width (never upscales images)",
        "type": "integer",
        "minimum": 1,
        "maximum": 20000
      },
      "height": {
        "description": "Resize images or video to this height",
        "type": "integer",
        "minimum": 1,
        "maximum": 20000
      },
      "strip": {
        "description": "Images: drop EXIF and other metadata",
        "type": "boolean"
      },
      "video_codec": {
        "description": "Video codec. Defaults to the container's usual one (h264 for mp4/mov/mkv, vp9 for webm).",
        "type": "string",
        "enum": [
          "h264",
          "h265",
          "vp9",
          "av1"
        ]
      },
      "crf": {
        "description": "Constant quality (lower is better). h264/h265 0-51 (default 23/28), vp9/av1 0-63.",
        "type": "integer",
        "minimum": 0,
        "maximum": 63
      },
      "video_bitrate": {
        "description": "Video bitrate in kbps (instead of crf)",
        "type": "integer",
        "minimum": 50,
        "maximum": 100000
      },
      "fps": {
        "description": "Output frame rate",
        "type": "number",
        "minimum": 1,
        "maximum": 120
      },
      "audio": {
        "description": "Video: keep the audio track (default true)",
        "type": "boolean"
      },
      "audio_bitrate": {
        "description": "Audio bitrate in kbps (ignored for lossless formats)",
        "type": "integer",
        "minimum": 8,
        "maximum": 512
      },
      "sample_rate": {
        "description": "Sample rate in Hz, e.g. 44100 or 48000",
        "type": "number",
        "enum": [
          8000,
          11025,
          16000,
          22050,
          24000,
          32000,
          44100,
          48000,
          96000
        ]
      },
      "channels": {
        "description": "Audio channels (1 = mono, 2 = stereo)",
        "type": "integer",
        "minimum": 1,
        "maximum": 8
      },
      "start": {
        "description": "Video to image: the frame to grab",
        "anyOf": [
          {
            "type": "number",
            "minimum": 0,
            "maximum": 86400
          },
          {
            "type": "string",
            "pattern": "^(\\d{1,2}:){0,2}\\d{1,5}(\\.\\d{1,3})?$"
          }
        ]
      }
    },
    "required": [
      "file",
      "to"
    ]
  },
  "kind": "tool"
}