Skip to main content
Glama

pilot_screenshot

Capture screenshots of web pages or specific elements using browser automation. Specify full-page captures, element references, or custom clip regions for precise documentation and analysis.

Instructions

Take a screenshot of the page or a specific element.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoElement ref or CSS selector to screenshot
full_pageNoCapture full page (default: true)
output_pathNoOutput file path
clipNoClip region {x, y, width, height}

Implementation Reference

  • Handler function for pilot_screenshot which takes a screenshot using Playwright and returns it as an MCP image content.
    async ({ ref, full_page, output_path, clip }) => {
      await bm.ensureBrowser();
      try {
        const page = bm.getPage();
        const screenshotPath = output_path || path.join(TEMP_DIR, 'pilot-screenshot.png');
    
        if (ref) {
          const resolved = await bm.resolveRef(ref);
          const locator = 'locator' in resolved ? resolved.locator : page.locator(resolved.selector);
          await locator.screenshot({ path: screenshotPath, timeout: 5000 });
        } else if (clip) {
          await page.screenshot({ path: screenshotPath, clip });
        } else {
          await page.screenshot({ path: screenshotPath, fullPage: full_page !== false });
        }
    
        const imageData = fs.readFileSync(screenshotPath);
        const base64 = imageData.toString('base64');
    
        return {
          content: [
            { type: 'text' as const, text: `Screenshot saved: ${screenshotPath}` },
            { type: 'image' as const, data: base64, mimeType: 'image/png' },
          ],
        };
      } catch (err) {
        return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
      }
    }
  • Input schema for pilot_screenshot tool.
    {
      ref: z.string().optional().describe('Element ref or CSS selector to screenshot'),
      full_page: z.boolean().optional().describe('Capture full page (default: true)'),
      output_path: z.string().optional().describe('Output file path'),
      clip: z.object({
        x: z.number(),
        y: z.number(),
        width: z.number(),
        height: z.number(),
      }).optional().describe('Clip region {x, y, width, height}'),
    },
  • Full registration of the pilot_screenshot tool.
    server.tool(
      'pilot_screenshot',
      'Take a screenshot of the page or a specific element.',
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 reveals only that a screenshot is taken. It omits critical behavioral details: return value format (binary data vs file path reference), whether the operation waits for page stability, supported image formats, and the interaction between `full_page`, `ref`, and `clip` parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The single sentence is efficient with no redundant words. However, given the tool's complexity (nested clip object, file output, multiple screenshot modes), the extreme brevity may be insufficient rather than optimally concise.

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?

With no output schema and no annotations, the description should explain return behavior and side effects (file writing). It also fails to address the similar sibling tool `pilot_annotated_screenshot` or clarify precedence rules between the four parameters (e.g., if `ref` and `clip` conflict).

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?

Schema coverage is 100% (all 4 parameters have descriptions). The description provides semantic framing by mentioning 'page or a specific element' which maps to the `full_page` and `ref` parameters, but adds no syntax guidance or parameter interaction rules beyond the schema.

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 verb "Take" and resource "screenshot" with scope "page or a specific element." However, it fails to distinguish from sibling tool `pilot_annotated_screenshot`, which also takes screenshots but likely adds annotations.

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?

No guidance provided on when to use this versus `pilot_annotated_screenshot` or other page inspection tools like `pilot_snapshot`. No prerequisites mentioned (e.g., requiring a loaded page).

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/TacosyHorchata/Pilot'

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