Skip to main content
Glama

Convert file

convert_file

Convert and process PDFs and images by running FlexFiles actions on local files or HTTPS links, then save results locally without changing originals.

Instructions

Run a FlexFiles tool on local files or https links and save the result locally. Originals are never changed. Actions:

  • merge-pdf: Combine PDFs into one file, in the order given.

  • add-page-to-pdf: Insert the pages of a second PDF into the first one.

  • protect-pdf: Add a password to a PDF.

  • unlock-pdf: Remove the password from a PDF you know the password for.

  • search-and-replace: Find text in a PDF and replace it.

  • split-pdf: Split a PDF into several files with a fixed number of pages each.

  • remove-pdf-pages: Delete pages from a PDF.

  • add-header-footer: Add header and/or footer text to PDF pages.

  • add-link-to-pdf: Make URLs and email addresses in a PDF clickable, or link chosen text.

  • pdf-to-jpg: Turn PDF pages into JPG images.

  • pdf-to-word: Convert a PDF to an editable Word document (.docx).

  • html-to-pdf: Convert an HTML file to PDF.

  • pdf-to-html: Convert a PDF to an HTML page.

  • pdf-to-pptx: Convert a PDF to a PowerPoint presentation (.pptx).

  • pdf-to-txt: Extract the text of a PDF into a .txt file.

  • extract-pdf-images: Save the images inside a PDF as separate files.

  • pdf-to-excel: Extract tables from a PDF into an Excel workbook (.xlsx).

  • compress-pdf: Make a PDF file smaller.

  • convert-image: Convert images to another format (PNG, JPEG, WebP and more).

  • enhance-image: Upscale and sharpen images.

  • remove-background: Remove the background from images, or replace it with a colour or another image.

  • tiny-image: Make images smaller.

  • ocr-pdf: Make a scanned PDF's text searchable and selectable.

  • deskew-pdf: Straighten tilted scanned pages.

  • word-to-pdf: Convert a Word document (.doc or .docx) to PDF.

  • repair-pdf: Recover a damaged or corrupted PDF.

  • jpg-to-pdf: Combine images into one PDF, one image per page.

  • flatten-pdf: Bake form fields and annotations into the page so they can't be edited.

  • remove-annotations: Remove highlights, comments, drawings, form fields or links from a PDF. Settings go in options (call list_tools with the action to see them).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "action": "<action>",
      "files": "<files>"
    },
    "name": "convert_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYesLocal file paths (absolute, or relative to the working directory) or https links, in order
actionYesThe FlexFiles tool to run
optionsNoThe tool's settings, e.g. {"compressionPreset": "maximum"} or {"password": "..."}
save_toNoFolder to save the result in (default: the first input file's folder)
downloadNoSave the result locally (default true); false returns download links only
wait_secondsNoHow long to wait for the result before handing back a conversion_id (default 50)
background_imageNoremove-background only: local image to use as the new background

Output Schema

NameRequiredDescriptionDefault
doneYestrue once completed or failed
nextNoWhat to do next when the job isn't finished or failed
errorNo
actionNo
statusYespending, queued, processing, completed or failed
zipUrlNoSigned download link for all outputs as one ZIP
resultUrlNoSigned download link for the (first) output
inputFilesYes
savedFilesNoLocal paths the result was saved to
outputCountNo
zipFileNameNo
conversionIdYes
resultNoticeNoPresent when the result is partial or the input was damaged
queuePositionNo
resultFileNameNo
estimatedSecondsNo
expiresInSecondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true; the description adds real value on top by confirming originals are immutable, that results are saved locally by default, and by describing what each action actually does to the file. It omits the asynchronous flow (conversion_id hand-back) and any limits or auth expectations, but the per-action semantics go well beyond the annotation set.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose and scope, then a scannable bulleted action list. The bullets partially restate the action enum already in the schema, but each line adds behavioral meaning (e.g. 'in the order given', 'you know the password for') that the bare enum values do not carry, so the length is largely earned.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 29-action router with 7 parameters and an output schema, the description covers purpose, file inputs, per-action meaning, and settings discovery. The main remaining gap is the async lifecycle — what to do with a returned conversion_id and how get_conversion fits — which is only hinted at through the wait_seconds schema text.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds one useful pointer beyond the schema — that per-action settings belong in the free-form options bag and can be discovered via list_tools — and reinforces ordering semantics for merge-pdf, but does not explain save_to, download, or wait_seconds interactions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Run a FlexFiles tool on local files or https links and save the result locally') and then enumerates all 29 supported actions with a one-line gloss each, so an agent can map a user request to an action without opening the schema. It is clearly distinguishable from siblings list_tools/get_conversion/list_conversions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides concrete routing guidance: 'Settings go in options (call list_tools with the action to see them)', which tells the agent exactly where to look for per-action settings. It also states 'Originals are never changed', setting expectations for safe experimentation. It stops short of stating when to use get_conversion after wait_seconds elapses, so the async hand-off is left implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.