Utilitly PDF

v0.1.1
com.utilitly/mcp Checked 3 hours ago Published 1 month ago

Merge, split, rotate, delete, reorder and duplicate PDF pages on your computer.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

pdf_info PDF info

Reads a PDF and reports its page count, file size, first page size in points, and whether it is password-protected. Changes nothing.

ParameterTypeDescription
path *stringAbsolute path to a PDF file, or one starting with ~/.

merge_pdfs Merge PDFs

Combines PDFs into one, in the order given. The result is named after the first file, with -merged. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.

ParameterTypeDescription
paths *arrayAbsolute paths of the PDFs to combine, in order
output_pathstringOptional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input.

split_pdf Split a PDF

Splits a PDF into one new file per comma-separated range, named -part1, -part2 and so on. "1-2, 3-end" gives two files, and one call writes at most 1,000 (or one per page for longer PDFs). Never replaces an existing file; the input is left unchanged.

ParameterTypeDescription
path *stringAbsolute path to a PDF file, or one starting with ~/.
ranges *stringRanges such as "1-2, 3, 4-end": one output file per comma-separated part
output_folderstringOptional absolute path of an existing folder for the files. By default they go next to the input.

extract_pages Extract pages

Copies the selected pages into one new PDF, in page order, named with -pages. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.

ParameterTypeDescription
pages *stringPages, such as "2", "1-3, 5" or "4-end". Commas separate parts.
path *stringAbsolute path to a PDF file, or one starting with ~/.
output_pathstringOptional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input.

rotate_pdf Rotate pages

Turns pages clockwise by a multiple of 90 degrees (negative turns counter-clockwise), every page unless pages is given. Named with -rotated. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.

ParameterTypeDescription
angle *integerDegrees clockwise: 90, 180, 270, or -90 for counter-clockwise
path *stringAbsolute path to a PDF file, or one starting with ~/.
output_pathstringOptional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input.
pagesstringPages, such as "2", "1-3, 5" or "4-end". Commas separate parts. Every page when left out.

delete_pages Delete pages

Removes the selected pages and keeps the rest in order, named with -trimmed. At least one page must remain. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.

ParameterTypeDescription
pages *stringPages to remove, such as "2", "1-3, 5" or "4-end". Commas separate parts.
path *stringAbsolute path to a PDF file, or one starting with ~/.
output_pathstringOptional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input.

reorder_pages Reorder pages

Puts the pages in a new order, named with -reordered. The order must list every page exactly once; use pdf_info for the page count. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.

ParameterTypeDescription
order *arrayEvery page number once, in the new order, e.g. [3, 1, 2]
path *stringAbsolute path to a PDF file, or one starting with ~/.
output_pathstringOptional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input.

duplicate_pages Duplicate pages

Adds copies of the selected pages, right after each one or all at the end, named with -duplicated. Copies share the page's images, so the file barely grows. One call can add at most 10,000 pages. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.

ParameterTypeDescription
pages *stringPages to copy, such as "2", "1-3, 5" or "4-end". Commas separate parts.
path *stringAbsolute path to a PDF file, or one starting with ~/.
copiesintegerExtra copies of each page. Default 1.
output_pathstringOptional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input.
placementstring"after" (default) puts copies right after each page; "end" adds them at the end.