Skip to main content
Glama

screenshot

Capture web page screenshots using the MCP Browser Server. Save specific sections or full scrollable pages, with optional custom save paths for efficient web automation and documentation.

Instructions

Take a screenshot of the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullPageNoCapture full scrollable page
pathNoPath to save screenshot (optional)

Implementation Reference

  • Handler for the 'screenshot' tool. Validates input using ScreenshotSchema, captures screenshot of current page using Playwright's page.screenshot() with options fullPage and path, returns textual confirmation with buffer size or save path.
    case 'screenshot': { if (!currentPage) { throw new Error('No browser page available. Launch a browser first.'); } const params = ScreenshotSchema.parse(args); const buffer = await currentPage.screenshot({ fullPage: params.fullPage, path: params.path }); const result = params.path ? `Screenshot saved to: ${params.path}` : `Screenshot captured (${buffer.length} bytes)`; return { content: [ { type: 'text', text: result } ] }; }
  • Zod schema for screenshot tool inputs: fullPage (boolean, optional, defaults to false), path (string, optional).
    const ScreenshotSchema = z.object({ fullPage: z.boolean().default(false), path: z.string().optional() });
  • src/index.ts:220-235 (registration)
    Tool registration in ListTools response: defines name 'screenshot', description, and inputSchema matching ScreenshotSchema.
    name: 'screenshot', description: 'Take a screenshot of the current page', inputSchema: { type: 'object', properties: { fullPage: { type: 'boolean', default: false, description: 'Capture full scrollable page' }, path: { type: 'string', description: 'Path to save screenshot (optional)' } } }

Other Tools

Related 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/Wladastic/mcp-browser-server'

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