Skip to main content
Glama

take_screenshot

Capture webpage screenshots in PNG, JPEG, or WebP formats with options for full-page capture, quality control, and specific region selection.

Instructions

Take screenshot of a webpage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
optionsNo

Implementation Reference

  • Core implementation of the take_screenshot tool: sends POST /screenshot to Browserless API, receives image buffer, formats response with filename.
    async takeScreenshot(request: ScreenshotRequest): Promise<BrowserlessResponse<ScreenshotResponse>> {
      try {
        const response: AxiosResponse<Buffer> = await this.httpClient.post('/screenshot', request, {
          responseType: 'arraybuffer',
          headers: {
            'Content-Type': 'application/json',
          },
        });
    
        const format = request.options?.type || 'png';
        const filename = `screenshot-${Date.now()}.${format}`;
    
        return {
          success: true,
          data: {
            image: Buffer.from(response.data),
            filename,
            format,
          },
        };
      } catch (error) {
        return this.handleError(error);
      }
    }
  • MCP server dispatch handler for 'take_screenshot': calls BrowserlessClient.takeScreenshot and returns MCP-formatted response with base64 image.
    case 'take_screenshot': {
      if (!args) throw new Error('Arguments are required');
      const result = await this.client!.takeScreenshot(args as any);
      if (result.success && result.data) {
        return {
          content: [
            {
              type: 'text',
              text: `Screenshot taken successfully. Filename: ${result.data.filename}`,
            },
            {
              type: 'binary',
              mimeType: `image/${result.data.format}`,
              data: result.data.image.toString('base64'),
            },
          ],
        };
      } else {
        throw new Error(result.error || 'Failed to take screenshot');
      }
    }
  • src/index.ts:81-109 (registration)
    Tool registration in MCP ListToolsResponse: defines name, description, and JSON input schema for 'take_screenshot'.
    {
      name: 'take_screenshot',
      description: 'Take screenshot of a webpage',
      inputSchema: {
        type: 'object',
        properties: {
          url: { type: 'string' },
          options: {
            type: 'object',
            properties: {
              type: { type: 'string', enum: ['png', 'jpeg', 'webp'] },
              quality: { type: 'number' },
              fullPage: { type: 'boolean' },
              omitBackground: { type: 'boolean' },
              clip: {
                type: 'object',
                properties: {
                  x: { type: 'number' },
                  y: { type: 'number' },
                  width: { type: 'number' },
                  height: { type: 'number' },
                },
              },
            },
          },
        },
        required: ['url'],
      },
    },
  • Zod schema (ScreenshotRequestSchema) and TypeScript type for screenshot requests used internally by BrowserlessClient.
    export const ScreenshotRequestSchema = z.object({
      url: z.string(),
      options: ScreenshotOptionsSchema.optional(),
      addScriptTag: z.array(ScriptTagSchema).optional(),
      addStyleTag: z.array(StyleTagSchema).optional(),
      cookies: z.array(CookieSchema).optional(),
      headers: z.record(z.string()).optional(),
      viewport: ViewportSchema.optional(),
      gotoOptions: z.object({
        waitUntil: z.string().optional(),
        timeout: z.number().optional(),
      }).optional(),
      waitForSelector: WaitForSelectorSchema.optional(),
      waitForFunction: WaitForFunctionSchema.optional(),
      waitForTimeout: z.number().optional(),
    });
    
    export type ScreenshotRequest = z.infer<typeof ScreenshotRequestSchema>;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Take screenshot') but doesn't describe what happens during execution—such as whether it opens a browser, requires network access, has timeouts, returns binary data, or handles errors. For a tool with potential complexity (browser interaction, image generation), this lack of behavioral context 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 a single, efficient sentence ('Take screenshot of a webpage') with zero wasted words. It's front-loaded with the core action, making it easy to parse quickly. Every word earns its place by conveying the essential purpose without redundancy or fluff.

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 (browser-based screenshot capture with multiple parameters), no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't address how the tool behaves, what it returns (e.g., image data, file path), or parameter usage, leaving critical gaps for the agent to operate effectively.

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 fails to do so. It mentions no parameters, while the schema has 2 parameters ('url' and 'options') with nested properties like 'type', 'quality', and 'clip'. The description adds no meaning beyond the schema, leaving parameters undocumented in both places. With low coverage and no compensation, this scores below the baseline.

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 screenshot of a webpage' clearly states the verb ('Take') and resource ('screenshot of a webpage'), making the purpose immediately understandable. It distinguishes from siblings like 'generate_pdf' or 'export_page' by specifying screenshot capture rather than PDF generation or general export. However, it doesn't explicitly differentiate from all possible screenshot-related tools (though none exist in the sibling list), keeping it at 4 rather than 5.

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., webpage must be accessible), compare to siblings like 'generate_pdf' for document output or 'export_page' for other export types, or specify scenarios where screenshots are preferred. The agent must infer usage from the tool name 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/Lizzard-Solutions/browserless-mcp'

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