Skip to main content
Glama

browser_screenshot

Capture screenshots from web browsers using Playwright sessions. Manage multiple concurrent instances with automatic cleanup for efficient browser automation.

Instructions

Take screenshot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullPageNo

Implementation Reference

  • index.js:352-358 (registration)
    Registration of the 'browser_screenshot' tool. It validates input via zod schema and then calls 'proxyToolCall' with the actual tool name 'browser_take_screenshot'.
    server.tool('browser_screenshot', 'Take screenshot', {
      fullPage: z.boolean().optional()
    }, async (args) => {
      const check = requireActivePage();
      if (check) return check;
      return proxyToolCall('browser_take_screenshot', args);
    });
  • The 'proxyToolCall' function acts as a wrapper that forwards tool requests to an external client instance. This handles the actual execution logic for tools like 'browser_take_screenshot'.
    async function proxyToolCall(toolName, args) {
      log(`[proxyToolCall] ${toolName} with args: ${JSON.stringify(args)}`);
      const { client } = await getOrCreateInstance();
      log(`[proxyToolCall] got client for port ${assignedPort}`);
    
      // Update last used
      if (assignedPort && instances.has(assignedPort)) {
        instances.get(assignedPort).lastUsed = Date.now();
      }
    
      try {
        log(`[proxyToolCall] Calling client.callTool...`);
        const result = await client.callTool({ name: toolName, arguments: args || {} });
        log(`[proxyToolCall] Result type: ${typeof result}`);
        log(`[proxyToolCall] Result: ${JSON.stringify(result).slice(0, 500)}`);
    
        // The SDK returns { content: [...], isError?: boolean }
        // We need to return this same format
        if (result && result.content) {
          return result;
        }
    
        // Fallback: wrap in content array if needed
        return {
          content: [{ type: 'text', text: JSON.stringify(result) }]
        };
      } catch (error) {
        log(`[proxyToolCall] ERROR: ${error.message}\n${error.stack}`);
        return {

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/OMGEverdo/browser-pool-mcp'

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