Skip to main content
Glama
pdfdotco

PDF.co MCP Server

Official
by pdfdotco

webpage_to_pdf

Convert a webpage URL to PDF. Customize page size, margins, orientation, headers, and footers to match your output requirements.

Instructions

Convert external webpage URL to PDF.
Ref: https://developer.pdf.co/api/pdf-from-url.md

The header and footer parameters can contain valid HTML markup with the following classes used to inject printing values into them:
- date: formatted print date
- title: document title
- url: document location
- pageNumber: current page number
- totalPages: total pages in the document
- img: tag is supported in both the header and footer parameter, provided that the src attribute is specified as a base64-encoded string.
For example, the following markup will generate Page N of NN page numbering:
```html
<span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span>

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to the source file (external webpage URL).
nameNoFile name for the generated output. (Optional)
footerNoUser definable HTML for the footer to be applied on every page footer. (Optional)
headerNoUser definable HTML for the header to be applied on every page header. (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)
marginsNoSet to CSS style margins like 10px, 5mm, 5in for all sides or 5px 5px 5px 5px (the order of margins is top, right, bottom, left). (Optional)
mediaTypeNoUses print by default. Set to screen to convert HTML as it appears in a browser or print to convert as it appears for printing or none to set none as mediaType for CSS styles. (Optional)
paperSizeNoA4 is set by default. Can be Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 or a custom size. Custom size can be set in px (pixels), mm or in (inches) with width and height separated by space like this: 200 300, 200px 300px, 200mm 300mm, 20cm 30cm or 6in 8in. (Optional)
orientationNoSet to Portrait or Landscape. Portrait is set by default. (Optional)
httppasswordNoHTTP auth password if required to access source url. (Optional)
httpusernameNoHTTP auth user name if required to access source url. (Optional)
printBackgroundNotrue by default. Set to false to disable printing of background. (Optional)
DoNotWaitFullLoadNofalse by default. Set to true to skip waiting for full load (like full video load etc. that may affect the total conversion time). (Optional)
Behavior3/5

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

With no annotations provided, the description carries the full transparency burden. It provides substantive detail about header/footer HTML markup and placeholder classes, which is useful, but it does not disclose authentication requirements (e.g., API key), return output format, or any asynchronous/job behavior.

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?

The core one-sentence purpose is concise and front-loaded. The extended header/footer section is relevant and instructive, though the overall length is slightly heavy for a simple conversion tool. Every sentence serves a purpose, but the detail could be streamlined.

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

Completeness3/5

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

Given 13 parameters, no annotations, and no output schema, the description is only partially complete. It does not explain the return value (e.g., PDF URL or job ID) or the authentication behavior in detail. The header/footer coverage is strong, but other operational aspects are left to the schema alone.

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

Parameters4/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 meaningful value by explaining valid HTML markup and the placeholder classes that can be used in the header and footer parameters, along with an example. This goes beyond the schema's minimal parameter descriptions.

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?

The description opens with a clear, specific statement: 'Convert external webpage URL to PDF.' This identifies the action (convert), the resource (external webpage URL), and the output (PDF). It also distinguishes from sibling tools like html_to_pdf by specifying URL-based conversion.

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

Usage Guidelines3/5

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

The description does not explicitly mention when to use this tool versus alternatives, nor does it state exclusions or prerequisites. The name and phrase 'external webpage URL' imply the use case, but there is no direct comparison to siblings like html_to_pdf or document_to_pdf.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pdfdotco/pdfco-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server