Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

screenshot

Capture web page screenshots with customizable viewport dimensions, image formats, and capture settings for documentation or analysis.

Instructions

Capture screenshots of web pages with customizable settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to capture
widthNoViewport width
heightNoViewport height
deviceScaleFactorNoDevice scale factor
fullPageNoCapture full page
formatNoImage format
qualityNoImage quality (1-100)
renderJsNoRender JavaScript
waitNoWait time in ms before capture
clipRectangleNoArea to clip
blockCookieBannersNoBlock cookie banners
autoScrollNoAuto-scroll page

Implementation Reference

  • The handler function executes the screenshot tool by sending a POST request to the DumplingAI API endpoint `/api/v1/screenshot` with the provided parameters and returns the JSON response.
    async ({ url, width, height, deviceScaleFactor, fullPage, format, quality, renderJs, wait, clipRectangle, blockCookieBanners, autoScroll, }) => { const apiKey = process.env.DUMPLING_API_KEY; if (!apiKey) throw new Error("DUMPLING_API_KEY not set"); const response = await fetch(`${NWS_API_BASE}/api/v1/screenshot`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ url, width, height, deviceScaleFactor, fullPage, format, quality, renderJs, waitFor: wait, clipRectangle, blockCookieBanners, autoScroll, }), }); if (!response.ok) throw new Error(`Failed: ${response.status} ${await response.text()}`); const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; }
  • Zod schema defining the input parameters for the screenshot tool, including URL, dimensions, format options, and other screenshot settings.
    { url: z.string().url().describe("URL to capture"), width: z.number().optional().describe("Viewport width"), height: z.number().optional().describe("Viewport height"), deviceScaleFactor: z.number().optional().describe("Device scale factor"), fullPage: z.boolean().optional().describe("Capture full page"), format: z.enum(["png", "jpeg"]).optional().describe("Image format"), quality: z.number().optional().describe("Image quality (1-100)"), renderJs: z.boolean().optional().describe("Render JavaScript"), wait: z .number() .min(0) .max(5000) .default(0) .describe("Wait time in ms before capture"), clipRectangle: z .object({ top: z.number(), left: z.number(), width: z.number(), height: z.number(), }) .optional() .describe("Area to clip"), blockCookieBanners: z .boolean() .optional() .default(true) .describe("Block cookie banners"), autoScroll: z.boolean().optional().describe("Auto-scroll page"), },
  • src/index.ts:441-518 (registration)
    The server.tool call that registers the "screenshot" tool with its description, input schema, and handler function.
    // Tool to capture screenshots server.tool( "screenshot", "Capture screenshots of web pages with customizable settings.", { url: z.string().url().describe("URL to capture"), width: z.number().optional().describe("Viewport width"), height: z.number().optional().describe("Viewport height"), deviceScaleFactor: z.number().optional().describe("Device scale factor"), fullPage: z.boolean().optional().describe("Capture full page"), format: z.enum(["png", "jpeg"]).optional().describe("Image format"), quality: z.number().optional().describe("Image quality (1-100)"), renderJs: z.boolean().optional().describe("Render JavaScript"), wait: z .number() .min(0) .max(5000) .default(0) .describe("Wait time in ms before capture"), clipRectangle: z .object({ top: z.number(), left: z.number(), width: z.number(), height: z.number(), }) .optional() .describe("Area to clip"), blockCookieBanners: z .boolean() .optional() .default(true) .describe("Block cookie banners"), autoScroll: z.boolean().optional().describe("Auto-scroll page"), }, async ({ url, width, height, deviceScaleFactor, fullPage, format, quality, renderJs, wait, clipRectangle, blockCookieBanners, autoScroll, }) => { const apiKey = process.env.DUMPLING_API_KEY; if (!apiKey) throw new Error("DUMPLING_API_KEY not set"); const response = await fetch(`${NWS_API_BASE}/api/v1/screenshot`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ url, width, height, deviceScaleFactor, fullPage, format, quality, renderJs, waitFor: wait, clipRectangle, blockCookieBanners, autoScroll, }), }); if (!response.ok) throw new Error(`Failed: ${response.status} ${await response.text()}`); const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );

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/DumplingAI/mcp-server-dumplingai'

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