PolyDoc ACTION
Capture Screenshot
Capture a screenshot of a URL, inline HTML, or a saved template. See the documentation.
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's PolyDoc account once, then configure and run Capture Screenshot 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: "polydoc-convert-screenshot",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
polydoc: { authProvisionId: "apn_xxxxxxx" },
sourceType: "Source Type",
url: "URL",
},
})
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": "polydoc-convert-screenshot",
"configured_props": {
"polydoc": { "authProvisionId": "apn_xxxxxxx" },
"sourceType": "Source Type",
"url": "URL"
}
}'// 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": "polydoc",
},
},
},
)
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: "polydoc-convert-screenshot",
arguments: {
sourceType: "Source Type",
url: "URL",
},
})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 |
|---|---|---|
sourceType Source Type | string | Where the content to render comes from. Required |
url URL | string | The web page to render. Used when Source Type is url. Optional |
html HTML | string | Inline HTML to render. Used when Source Type is html. Optional |
templateId Template ID | string | ID of a template saved in PolyDoc (for example jlE-whg). Used when Source Type is template. Optional |
templateData Template Data | object | Key-value data passed to the Liquid template renderer. Example: { "customerName": "Ada Lovelace", "invoiceNumber": "INV-1001" }. Used when Source Type is template. Optional |
imageType Image Type | string | Screenshot image format. Optional |
fullPage Full Page | boolean | Capture the entire scrollable page. Optional |
quality Quality | integer | Compression quality 0-100 for JPEG / WebP. Optional |
viewportWidth Viewport Width | integer | Viewport width in pixels. Optional |
viewportHeight Viewport Height | integer | Viewport height in pixels. Optional |
devicePixelRatio Device Pixel Ratio | integer | Device pixel ratio (0-10). Optional |
outputEncoding Output Encoding | string | Return the screenshot as a binary file or a base64 string. Optional |
filename Filename | string | Output filename, used in the file written for download delivery. Optional |
tag Tag | string | A short label (max 30 chars) for logging and analytics. Optional |
timeout Timeout (ms) | integer | Conversion timeout in milliseconds. The free tier is capped at 30000. Optional |
deliveryMode Delivery Mode | string | How the result is delivered. Required |
presignedUrl Presigned URL | string | A presigned upload URL (S3 / GCS / Azure). Used when Delivery Mode is cloudStorage. Optional |
webhookUrl Webhook URL | string | The URL the file is delivered to. Used when Delivery Mode is webhook. Optional |
webhookOptions Webhook Options | object | Optional webhook settings. Example: { "async": true, "method": "POST", "headers": { "X-Signature": "abc123" }, "retries": 3, "retryDelay": 1000, "timeout": 10000 }. Optional |
advanced Advanced (JSON) | object | Raw object deep-merged into the request body for any API field not exposed above (for example pdf.watermark, pdf.pdfa, render, request). Advanced values win on conflict. 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
- polydoc-convert-screenshot
- Version
- 0.0.2
- App
- PolyDoc
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗