Skip to main content
Glama

screenshot

Capture screenshots in Firefox using Playwright automation. Specify file path, tab ID, and full-page options for precise browser image capturing.

Instructions

Take a screenshot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullPageNo
pathNoscreenshot.png
tabIdNo

Implementation Reference

  • The handler function for the 'screenshot' MCP tool. It ensures the browser is running, extracts path and fullPage from arguments (with defaults), calls page.screenshot from Playwright, and returns a text confirmation.
    //   async screenshot(args = {}) {
    //     this.ensureBrowserRunning();
    //     const { path = 'screenshot.png', fullPage = false } = args;
        
    //     await this.page.screenshot({
    //       path,
    //       fullPage
    //     });
        
    //     return {
    //       content: [
    //         {
    //           type: 'text',
    //           text: `Screenshot saved to: ${path}`
    //         }
    //       ]
    //     };
    //   }
  • The schema definition for the 'screenshot' tool, including name, description, and inputSchema specifying optional path (default 'screenshot.png') and fullPage (default false) parameters.
    //             description: 'Take a screenshot of the current page',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 path: {
    //                   type: 'string',
    //                   description: 'File path to save screenshot',
    //                   default: 'screenshot.png'
    //                 },
    //                 fullPage: {
    //                   type: 'boolean',
    //                   description: 'Capture full page',
    //                   default: false
    //                 }
    //               }
    //             }
  • index.js:247-248 (registration)
    Registration of the 'screenshot' tool handler in the switch statement within the CallToolRequestSchema request handler.
    //           case 'screenshot':
    //             return await this.screenshot(args);
  • index.js:35-226 (registration)
    The listTools response includes the 'screenshot' tool in the tools array (specific block at 135-152). This registers the tool's metadata for MCP clients.
    //         tools: [
    //           {
    //             name: 'launch_firefox',
    //             description: 'Launch Firefox browser',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 headless: {
    //                   type: 'boolean',
    //                   description: 'Run browser in headless mode',
    //                   default: false
    //                 },
    //                 url: {
    //                   type: 'string',
    //                   description: 'Initial URL to navigate to',
    //                   default: 'about:blank'
    //                 }
    //               }
    //             }
    //           },
    //           {
    //             name: 'navigate',
    //             description: 'Navigate to a URL',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 url: {
    //                   type: 'string',
    //                   description: 'URL to navigate to'
    //                 }
    //               },
    //               required: ['url']
    //             }
    //           },
    //           {
    //             name: 'click',
    //             description: 'Click on an element',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 selector: {
    //                   type: 'string',
    //                   description: 'CSS selector or text content to click'
    //                 },
    //                 coordinates: {
    //                   type: 'object',
    //                   properties: {
    //                     x: { type: 'number' },
    //                     y: { type: 'number' }
    //                   },
    //                   description: 'Click at specific coordinates (alternative to selector)'
    //                 }
    //               }
    //             }
    //           },
    //           {
    //             name: 'type_text',
    //             description: 'Type text into an input field',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 selector: {
    //                   type: 'string',
    //                   description: 'CSS selector of the input field'
    //                 },
    //                 text: {
    //                   type: 'string',
    //                   description: 'Text to type'
    //                 }
    //               },
    //               required: ['selector', 'text']
    //             }
    //           },
    //           {
    //             name: 'get_page_content',
    //             description: 'Get the HTML content of the current page',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 selector: {
    //                   type: 'string',
    //                   description: 'CSS selector to get specific element content (optional)'
    //                 }
    //               }
    //             }
    //           },
    //           {
    //             name: 'get_page_text',
    //             description: 'Get the visible text content of the current page',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 selector: {
    //                   type: 'string',
    //                   description: 'CSS selector to get specific element text (optional)'
    //                 }
    //               }
    //             }
    //           },
    //           {
    //             name: 'screenshot',
    //             description: 'Take a screenshot of the current page',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 path: {
    //                   type: 'string',
    //                   description: 'File path to save screenshot',
    //                   default: 'screenshot.png'
    //                 },
    //                 fullPage: {
    //                   type: 'boolean',
    //                   description: 'Capture full page',
    //                   default: false
    //                 }
    //               }
    //             }
    //           },
    //           {
    //             name: 'wait_for_element',
    //             description: 'Wait for an element to appear on the page',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 selector: {
    //                   type: 'string',
    //                   description: 'CSS selector to wait for'
    //                 },
    //                 timeout: {
    //                   type: 'number',
    //                   description: 'Timeout in milliseconds',
    //                   default: 30000
    //                 }
    //               },
    //               required: ['selector']
    //             }
    //           },
    //           {
    //             name: 'execute_script',
    //             description: 'Execute JavaScript in the browser',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {
    //                 script: {
    //                   type: 'string',
    //                   description: 'JavaScript code to execute'
    //                 }
    //               },
    //               required: ['script']
    //             }
    //           },
    //           {
    //             name: 'close_browser',
    //             description: 'Close the Firefox browser',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {}
    //             }
    //           },
    //           {
    //             name: 'get_current_url',
    //             description: 'Get the current page URL',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {}
    //             }
    //           },
    //           {
    //             name: 'back',
    //             description: 'Navigate back in browser history',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {}
    //             }
    //           },
    //           {
    //             name: 'forward',
    //             description: 'Navigate forward in browser history',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {}
    //             }
    //           },
    //           {
    //             name: 'reload',
    //             description: 'Reload the current page',
    //             inputSchema: {
    //               type: 'object',
    //               properties: {}
    //             }
    //           }
    //         ],
  • Helper method called by screenshot handler to ensure browser and page are initialized before taking screenshot.
    //   ensureBrowserRunning() {
    //     if (!this.browser || !this.page) {
    //       throw new Error('Firefox browser is not running. Please launch it first using the launch_firefox tool.');
    //     }
    //   }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. 'Take a screenshot' implies a read operation that captures visual data, but it doesn't disclose critical traits like whether it requires specific permissions, affects browser state, has rate limits, or what happens on failure. For a tool with 3 parameters and no annotation coverage, this is a significant gap.

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 extremely concise with just three words, front-loading the core action without any wasted text. Every word earns its place by directly conveying the tool's purpose, making it efficient and easy to parse.

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 3 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain parameter roles, behavioral constraints, or return values, leaving gaps for a tool that likely interacts with browser state. More context is needed for effective use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what 'fullPage', 'path', or 'tabId' mean, their defaults, or how they affect the screenshot. With 3 undocumented parameters, the description fails to provide meaningful semantics beyond the basic action.

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 'Take a screenshot' clearly states the action (take) and resource (screenshot), making the purpose immediately understandable. It distinguishes from siblings like 'get_page_content' or 'get_page_text' by specifying visual capture rather than text extraction. However, it doesn't explicitly differentiate from all potential screenshot-related tools, keeping it from a perfect score.

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 prerequisites (e.g., needing an open browser/tab), exclusions, or comparisons to siblings like 'get_page_content' for non-visual data. Usage is implied by the action alone, with no contextual boundaries.

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

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/JediLuke/firefox-mcp-server'

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