Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

screenshot

Capture and save webpage screenshots using AdsPower LocalAPI MCP Server, with options to specify the save path and choose between full-page or partial snapshots for precise documentation or analysis.

Instructions

Get the screenshot of the page

Input Schema

NameRequiredDescriptionDefault
isFullPageNoThe is full page of the screenshot
savePathNoThe path to save the screenshot

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "isFullPage": { "description": "The is full page of the screenshot", "type": "boolean" }, "savePath": { "description": "The path to save the screenshot", "type": "string" } }, "type": "object" }

Implementation Reference

  • The main handler function for the 'screenshot' tool. It checks browser connection, generates a unique filename, saves screenshot to optional path or default downloads, converts to base64, stores in browser.screenshotsInstance Map, and returns the image data as an array with type, data, and mimeType.
    async screenshot({ savePath, isFullPage }: ScreenshotParams) { browser.checkConnected(); const filename = `screenshot-${Date.now()}-${Math.random().toString(36).substring(2, 15)}.png`; const outputPath = path.join(savePath || defaultDownloadsPath, filename); const screenshot = await browser.pageInstance!.screenshot({ path: outputPath, fullPage: isFullPage }); const screenshotBase64 = screenshot.toString('base64'); browser.screenshotsInstance.set(filename, screenshotBase64); return [{ type: 'image' as const, data: screenshotBase64, mimeType: 'image/png' }]; },
  • Zod input schema for the screenshot tool, defining optional savePath (string) and isFullPage (boolean) parameters with descriptions.
    screenshotSchema: z.object({ savePath: z.string().optional().describe('The path to save the screenshot'), isFullPage: z.boolean().optional().describe('The is full page of the screenshot') }).strict(),
  • MCP server tool registration for 'screenshot', providing description, input schema shape, and wrapped handler from automationHandlers.
    server.tool('screenshot', 'Get the screenshot of the page', schemas.screenshotSchema.shape, wrapHandler(automationHandlers.screenshot));

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/AdsPower/local-api-mcp-typescript'

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