Docs · Updated 2026-10-05
PDF — tool reference
Process small PDFs in ToolCargo's own functions, without a separate PDF account or paid API.
Server URL: https://toolcargo.com/mcp/pdf · Scope: connector:pdf. Activate Site Audit (free) and create a PDF-scoped key or use OAuth. Each successful operation uses one shared plan call.
Sending and saving files
Every file, files or images value is canonical base64 of the file bytes, without a data URL prefix. Your assistant must be able to encode an uploaded file and save the returned base64. A local path or URL is not a file upload. ToolCargo does not fetch links or read your computer's folders.
const file = require("node:fs").readFileSync("input.pdf").toString("base64");Generated files return JSON with mimeType, filename, byteLength, pageCount and base64. Decode that value into a new file. Preserve the original.
require("node:fs").writeFileSync("result.pdf", Buffer.from(result.base64, "base64"));pdf_info
Inspect a base64 PDF: page count, page sizes/rotations, selected metadata and up to 100 AcroForm field names/types/options. No authenticity or signature assessment.
pdf_extract_text
Read embedded text from selected one-based pages (default first 10, maximum 20), capped at 50,000 characters. No OCR; layout and reading order may differ.
pdf_merge
Combine 2 to 10 base64 PDFs in input order. Returns base64 PDF bytes. Maximum 100 combined pages and 2 MiB input/output. Document-level forms, signatures and outlines are not preserved.
pdf_extract_pages
Create one PDF from selected unique one-based page numbers, in the supplied order. Call separately for each split. Source remains unchanged; document-level forms and signatures are not preserved.
pdf_rotate
Create a copy rotated by 90, 180 or 270 degrees clockwise, on selected pages or all pages. Existing rotation is retained and incremented. Can invalidate signatures.
pdf_images_to_pdf
Create an A4 PDF from 1 to 20 PNG/JPEG base64 images, one fitted image per page. At most 4096 pixels per side, 4 million pixels per image, 8 million combined and 2 MiB combined input/output.
pdf_text_to_pdf
Create an A4 PDF from up to 50,000 characters of plain Latin WinAnsi text. Lines wrap automatically. No HTML/CSS or Markdown rendering; unsupported scripts return an error.
pdf_html_to_pdf
Create an A4 PDF from up to 50,000 characters of HTML using semantic Latin WinAnsi layout: headings, paragraphs, emphasis, lists, code and table rows as text. No CSS, scripts, external assets or browser layout. Images become omission labels and links become text.
pdf_markdown_to_pdf
Create an A4 PDF from up to 50,000 characters of Markdown using the same bounded semantic layout. Headings, emphasis, lists, code and tables as row text; images omitted, no external requests. Latin WinAnsi only.
pdf_fill_form
Create a copy with explicit standard AcroForm text, checkbox and choice values. Inspect names/options with pdf_info. Interactive by default; flatten only when requested. No XFA or signature fields.
Example inputs
{ "text": "Quarterly report\nRevenue and next steps" }{ "file": "<base64 PDF bytes>" }{ "file": "<base64 PDF bytes>", "pages": [3, 1] }{ "file": "<base64 PDF bytes>", "pages": [1, 2], "degrees": 90 }{ "file": "<base64 PDF bytes>", "fields": { "name": "Ada", "approved": true }, "flatten": false }HTML and Markdown layout
Send html to pdf_html_to_pdf, or markdown to pdf_markdown_to_pdf, as a text string of at most 50,000 characters. These tools draw a semantic A4 report with headings, paragraphs, bold/italic emphasis, ordered/unordered lists, code blocks and automatic page breaks. Tables become row text separated by vertical bars; column widths and spreadsheet-style table layout are not preserved.
{ "html": "<h1>Quarterly report</h1><p>Total: <strong>42</strong></p><ul><li>Next steps</li></ul>" }{ "markdown": "# Quarterly report\n\n**Total**: 42\n\n- Next steps" }CSS, styles, scripts, browser layout, external fonts and embedded documents are not rendered. Script/style/iframe/object/SVG/media content is excluded. Images become omission labels using their alt text; links become text without active PDF link annotations. No URL or linked asset is fetched. Inline raw HTML in Markdown follows the same rules. This is useful for text reports, rather than a screenshot of a website. Text uses Latin WinAnsi fonts; Arabic, CJK and other unsupported scripts return an error without echoing their content.
Markup has at most 4,000 parser nodes, nesting depth 32, 2,000 text blocks and 250,000 characters after Markdown expands into HTML. The existing worker deadline, page and output limits still apply. Unsupported formatting may be omitted; inspect the generated PDF before sharing it.
Standard forms
Use pdf_info to find field names, types and declared choice options. Text fields accept strings, checkboxes accept booleans, dropdowns and radio groups accept a declared option, and option lists accept declared strings or arrays only when the original field permits multiple selections. Choice appearances use declared labels, while canonical field values preserve their export values. Read-only, signature and XFA fields are unsupported. The result stays interactive unless you explicitly set flatten: true, which removes editable fields.
Limits and privacy
Combined input files and generated output each have a 2 MiB binary limit. Documents have at most 100 pages; merges accept 2–10 files, image conversion 1–20 images, text extraction at most 20 selected pages and 50,000 output characters. Static images have at most 4 million pixels each and 8 million pixels combined. Animated PNGs and PNGs with compressed metadata are rejected. Page numbers start at 1. Processing runs in a worker with a 128 MiB heap limit and stops after 15 seconds; at most two workers run concurrently in one function instance.
Text extraction reads an existing text layer. It does not perform OCR, reconstruct tables or guarantee visual reading order. PDF creation uses Latin WinAnsi fonts. Plain-text conversion wraps text; the HTML/Markdown tools use the documented semantic subset, with no CSS/browser layout or unsupported scripts. Form appearances have the same font limitation. Password-protected and malformed files return an error.
File bytes and extracted content stay in memory for the operation; this connector does not persist them or send them to a PDF service. Your assistant, MCP client and hosting platform have their own retention policies. Do not submit documents you cannot share with them.
Generated documents are not sanitized or authenticated. Page assembly does not preserve document-level forms, outlines, attachments or digital signatures. Rotation and form filling may invalidate existing signatures and can retain active content. Review the output before using it. ToolCargo does not infer signatures, consent or attestations.
This is an original ToolCargo adapter using pdf-lib (MIT) and PDF.js (Apache-2.0), with Marked (MIT) and parse5 (MIT) for local markup parsing. It is not an official Adobe connector. Hosted MCP acceptance and a named assistant's ability to transfer files are separate checks.
Set up PDF
Review connection instructions, required credentials and plan limits before connecting your agent.