Puppeteer ACTION
Get PDF
Generate a PDF of a page using Puppeteer. See the documentation
- Action
- Read only
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Puppeteer account once, then configure and run Get PDF from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "puppeteer-get-pdf",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
puppeteer: { authProvisionId: "apn_xxxxxxx" },
url: "URL",
downloadPath: "Download Path",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "puppeteer-get-pdf",
"configured_props": {
"puppeteer": { "authProvisionId": "apn_xxxxxxx" },
"url": "URL",
"downloadPath": "Download Path"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "puppeteer",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "puppeteer-get-pdf",
arguments: {
url: "URL",
downloadPath: "Download Path",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
url URL | string | The URL of the page to scrape. For example, https://example.com. Required |
downloadPath Download Path | string | Download the PDF to the /tmp directory with the specified filename Optional |
displayHeaderFooter Display Header Footer | boolean | Whether to show the header and footer. Optional |
footerTemplate Footer Template | string | HTML template for the print footer. Optional |
format Format | string | The paper format of the PDF Optional |
headerTemplate Header Template | string | HTML template for the print header. Should be valid HTML with the following classes used to inject values into them: date - formatted print date, title - document title, url - document location, pageNumber - current page number, totalPages - total pages in the document. Optional |
height Height | string | Sets the height of paper. You can pass in a number or a string with a unit. Optional |
landscape Landscape | boolean | Whether to print in landscape orientation. Optional |
marginBottom Bottom Margin | string | Margin for the bottom of the page Optional |
marginLeft Left Margin | string | Margin for the left side of the page Optional |
marginRight Right Margin | string | Margin for the right side of the page Optional |
marginTop Top Margin | string | Margin for the top of the page Optional |
omitBackground Omit Background | boolean | Hides default white background and allows generating pdfs with transparency. Optional |
pageRanges Page Ranges | string | Paper ranges to print, e.g. 1-5, 8, 11-13. Optional |
preferCSSPageSize Prefer CSS Page Size | boolean | Give any CSS @page size declared in the page priority over what is declared in the width or height or format option. Optional |
printBackground Print Background | boolean | Set to true to print background graphics. Optional |
scale Scale | string | Scales the rendering of the web page. Amount must be between 0.1 and 2. Optional |
timeout Timeout | integer | Timeout in milliseconds. Pass 0 to disable timeout. Optional |
width Width | string | Sets the width of paper. You can pass in a number or a string with a unit. Optional |
syncDir SyncDir | dir | Required |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- puppeteer-get-pdf
- Version
- 1.0.5
- App
- Puppeteer
- Authentication
- API key
- Read-only
- Yes
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗