Skip to main content
Glama

render.screenshot

Capture webpage screenshots for security testing and documentation during bug bounty hunting and vulnerability assessment.

Instructions

Take a screenshot of a webpage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to screenshot
fullPageNoCapture full page
waitTimeNoWait time in ms before screenshot

Implementation Reference

  • The core handler function for the render.screenshot tool. Launches a Puppeteer browser, creates a new page, sets viewport, navigates to the URL, waits, takes a screenshot (fullPage option), saves to screenshots directory with timestamp filename, and returns success with file details or error.
    async ({ url, fullPage = false, waitTime = 2000 }: any): Promise<ToolResult> => {
      let page: Page | null = null;
      try {
        const browserInstance = await getBrowser();
        page = await browserInstance.newPage();
        
        await page.setViewport({ width: 1920, height: 1080 });
        await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000 });
        await new Promise(resolve => setTimeout(resolve, waitTime));
    
        const screenshotsDir = path.join(process.cwd(), 'screenshots');
        await fs.ensureDir(screenshotsDir);
        
        const filename = `screenshot_${Date.now()}.png`;
        const filepath = path.join(screenshotsDir, filename);
        
        await page.screenshot({
          path: filepath,
          fullPage,
        });
    
        await page.close();
    
        return formatToolResult(true, {
          url,
          screenshot: filepath,
          filename,
        });
      } catch (error: any) {
        if (page) await page.close().catch(() => {});
        return formatToolResult(false, null, error.message);
      }
    }
  • Input schema for the render.screenshot tool defining the expected parameters: url (required string), fullPage (optional boolean), waitTime (optional number).
      type: 'object',
      properties: {
        url: { type: 'string', description: 'URL to screenshot' },
        fullPage: { type: 'boolean', description: 'Capture full page', default: false },
        waitTime: { type: 'number', description: 'Wait time in ms before screenshot', default: 2000 },
      },
      required: ['url'],
    },
  • Registration of the render.screenshot tool using server.tool(), including name, description, inputSchema, and inline handler function. Called within registerRenderTools.
      'render.screenshot',
      {
        description: 'Take a screenshot of a webpage',
        inputSchema: {
          type: 'object',
          properties: {
            url: { type: 'string', description: 'URL to screenshot' },
            fullPage: { type: 'boolean', description: 'Capture full page', default: false },
            waitTime: { type: 'number', description: 'Wait time in ms before screenshot', default: 2000 },
          },
          required: ['url'],
        },
      },
      async ({ url, fullPage = false, waitTime = 2000 }: any): Promise<ToolResult> => {
        let page: Page | null = null;
        try {
          const browserInstance = await getBrowser();
          page = await browserInstance.newPage();
          
          await page.setViewport({ width: 1920, height: 1080 });
          await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000 });
          await new Promise(resolve => setTimeout(resolve, waitTime));
    
          const screenshotsDir = path.join(process.cwd(), 'screenshots');
          await fs.ensureDir(screenshotsDir);
          
          const filename = `screenshot_${Date.now()}.png`;
          const filepath = path.join(screenshotsDir, filename);
          
          await page.screenshot({
            path: filepath,
            fullPage,
          });
    
          await page.close();
    
          return formatToolResult(true, {
            url,
            screenshot: filepath,
            filename,
          });
        } catch (error: any) {
          if (page) await page.close().catch(() => {});
          return formatToolResult(false, null, error.message);
        }
      }
    );
  • Helper function to lazily initialize and return a shared Puppeteer Browser instance used by all render tools, including screenshot.
    async function getBrowser(): Promise<Browser> {
      if (!browser) {
        browser = await puppeteer.launch({
          headless: true,
          args: ['--no-sandbox', '--disable-setuid-sandbox'],
        });
      }
      return browser;
    }
  • src/index.ts:42-42 (registration)
    Invocation of registerRenderTools(server) which registers the render.screenshot tool (and others) on the main MCP Server instance.
    registerRenderTools(server);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Take a screenshot' implies a read operation, but it doesn't specify whether this requires specific permissions, what format the screenshot returns, if there are rate limits, or potential side effects like triggering security mechanisms. The description is minimal and lacks important behavioral context.

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 - a single six-word phrase that communicates the core function without any wasted words. It's perfectly front-loaded with the essential information, though this brevity comes at the cost of completeness in other dimensions.

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?

For a tool with no annotations and no output schema, the description is inadequate. It doesn't explain what the tool returns (image format, size, encoding), doesn't mention potential limitations or requirements, and provides no context about how this fits with sibling tools. The minimal description leaves significant gaps for the agent to navigate.

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

Parameters3/5

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

The description mentions no parameters, but schema description coverage is 100% - all three parameters (url, fullPage, waitTime) are fully documented in the schema with clear descriptions. The baseline score of 3 is appropriate since the schema does the heavy lifting, though the description adds no additional parameter context.

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 clearly states the action ('Take a screenshot') and target resource ('of a webpage'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'render.extract_dom' or 'render.execute_js' that also interact with webpages, so it doesn't reach the highest clarity level.

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. There's no mention of when screenshotting is appropriate compared to other render tools or security testing tools that might analyze webpage content differently. 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/telmon95/VulneraMCP'

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