Skip to main content
Glama

screenshot

Capture page screenshots during automated web testing to document visual states and verify UI elements.

Instructions

Take a screenshot of the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName for the screenshot file (without extension)

Implementation Reference

  • The screenshot method in the BrowserManager class that captures a screenshot of the current page using Puppeteer and saves it to a file with the given name.
    async screenshot(name: string) { const page = await this.init(); const filename = `${name.replace(/[^a-z0-9]/gi, '_').toLowerCase()}.png`; const filepath = path.resolve(process.cwd(), filename); await page.screenshot({ path: filepath }); return `Screenshot saved to ${filepath}`; }
  • The input schema and metadata definition for the 'screenshot' tool, including name, description, and input parameters.
    { name: "screenshot", description: "Take a screenshot of the current page", inputSchema: { type: "object", properties: { name: { type: "string", description: "Name for the screenshot file (without extension)" }, }, required: ["name"], }, },
  • src/index.ts:132-134 (registration)
    The dispatch logic in the CallToolRequestSchema handler that routes 'screenshot' tool calls to the browserManager.screenshot method.
    case "screenshot": result = await browserManager.screenshot(String(args?.name)); break;

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/samusilv/qa-agent-mcp'

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