Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

screenshot

Capture browser page screenshots using AdsPower LocalAPI, specifying save paths and full-page options for documentation or analysis.

Instructions

Get the screenshot of the page

Input Schema

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

Implementation Reference

  • The main handler function for the 'screenshot' tool. It captures a screenshot of the current browser page using Playwright, optionally saves it to a file, converts it to base64, stores it in the browser's screenshots map, and returns the image data.
    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 schema defining the input parameters for the screenshot tool: optional savePath (string) and isFullPage (boolean).
    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(),
  • Registers the 'screenshot' tool with the MCP server using server.tool(), providing the tool name, description, input schema, and the wrapped handler function.
    server.tool('screenshot', 'Get the screenshot of the page', schemas.screenshotSchema.shape,
        wrapHandler(automationHandlers.screenshot));
  • Getter for the screenshots Map instance used by the handler to store base64 screenshot data keyed by filename.
    get screenshotsInstance() {
        return this.screenshots;
    }
  • Helper function to retrieve a stored screenshot by filename from the browser's screenshots map (used in commented resource code).
    export const getScreenshot = (filename: string) => {
        return browser.screenshotsInstance.get(filename);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action ('Get the screenshot') but lacks behavioral details like whether it captures the current viewport or requires specific permissions, what happens if no page is open, or if there are rate limits. This is inadequate for a tool with potential side effects like file saving.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, making it easy to parse and front-loaded. It directly conveys the core action without unnecessary elaboration, earning full marks for conciseness.

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

Completeness2/5

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

Given the tool's complexity (involving browser interaction and file operations), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects, error conditions, or return values, leaving significant gaps for safe and effective use by an AI agent.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the two parameters ('savePath' and 'isFullPage'). The description adds no additional meaning beyond implying screenshot capture, resulting in a baseline score of 3 as it doesn't compensate but doesn't detract either.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get the screenshot of the page' clearly states the verb ('Get') and resource ('screenshot of the page'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-page-html' or 'get-page-visible-text', which also retrieve page content but in different formats, so it misses full sibling distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios like needing visual capture versus text/HTML extraction, or prerequisites such as requiring an open browser page, leaving the agent to infer usage from context alone.

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

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