Skip to main content
Glama

pilot_responsive

Capture full-page screenshots at mobile, tablet, and desktop breakpoints to verify responsive design. Viewport is restored after each capture.

Instructions

Capture full-page screenshots at three standard responsive breakpoints — mobile (375x812), tablet (768x1024), and desktop (1280x720). Use when the user wants to preview how a page looks across different screen sizes, test responsive design, or generate viewport comparison screenshots. The browser viewport is restored to its original size after capture.

Parameters:

  • output_prefix: File path prefix for the saved screenshots (default: /tmp/pilot-responsive). Files are saved as {prefix}-mobile.png, {prefix}-tablet.png, {prefix}-desktop.png

Returns: List of viewport names, dimensions, and file paths for each screenshot.

Errors:

  • "Output path must be within ...": The prefix path is outside the allowed directory.

  • Timeout: The page took too long to render at one of the viewports.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_prefixNoFile path prefix for screenshots

Implementation Reference

  • The tool registration and handler for 'pilot_responsive'. It captures full-page screenshots at three responsive breakpoints (mobile 375x812, tablet 768x1024, desktop 1280x720) and restores the original viewport afterwards.
      server.tool(
        'pilot_responsive',
        `Capture full-page screenshots at three standard responsive breakpoints — mobile (375x812), tablet (768x1024), and desktop (1280x720).
    Use when the user wants to preview how a page looks across different screen sizes, test responsive design, or generate viewport comparison screenshots. The browser viewport is restored to its original size after capture.
    
    Parameters:
    - output_prefix: File path prefix for the saved screenshots (default: /tmp/pilot-responsive). Files are saved as {prefix}-mobile.png, {prefix}-tablet.png, {prefix}-desktop.png
    
    Returns: List of viewport names, dimensions, and file paths for each screenshot.
    
    Errors:
    - "Output path must be within ...": The prefix path is outside the allowed directory.
    - Timeout: The page took too long to render at one of the viewports.`,
          { output_prefix: z.string().optional().describe('File path prefix for screenshots') },
        async ({ output_prefix }) => {
          await bm.ensureBrowser();
          try {
            const page = bm.getPage();
            const prefix = validateOutputPath(output_prefix || path.join(TEMP_DIR, 'pilot-responsive'));
            const viewports = [
              { name: 'mobile', width: 375, height: 812 },
              { name: 'tablet', width: 768, height: 1024 },
              { name: 'desktop', width: 1280, height: 720 },
            ];
            const originalViewport = page.viewportSize();
            const results: string[] = [];
    
            for (const vp of viewports) {
              await page.setViewportSize({ width: vp.width, height: vp.height });
              const filePath = `${prefix}-${vp.name}.png`;
              await page.screenshot({ path: filePath, fullPage: true });
              results.push(`${vp.name} (${vp.width}x${vp.height}): ${filePath}`);
            }
    
            if (originalViewport) await page.setViewportSize(originalViewport);
    
            return { content: [{ type: 'text' as const, text: results.join('\n') }] };
          } catch (err) {
            return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
          }
        }
      );
  • The input schema for pilot_responsive, accepting an optional 'output_prefix' string describing the file path prefix for screenshots.
    { output_prefix: z.string().optional().describe('File path prefix for screenshots') },
  • Where registerVisualTools (which contains pilot_responsive) is called during tool registration.
    registerVisualTools(effectiveServer, bm);
  • The exported function that registers all visual tools including pilot_responsive.
    export function registerVisualTools(server: McpServer, bm: BrowserManager) {
  • The validateOutputPath helper used by pilot_responsive to validate and resolve the output prefix path.
    export function validateOutputPath(outputPath: string): string {
      const allowed = process.env.PILOT_OUTPUT_DIR || os.tmpdir();
      let normalizedAllowed: string;
      try {
        normalizedAllowed = fs.realpathSync(path.resolve(allowed));
      } catch {
        normalizedAllowed = path.resolve(allowed);
      }
      try {
        const parentDir = path.dirname(outputPath);
        const realParent = fs.realpathSync(parentDir);
        const resolved = path.resolve(realParent, path.basename(outputPath));
        if (!resolved.startsWith(normalizedAllowed + path.sep) && resolved !== normalizedAllowed) {
          throw new Error(`Output path must be within ${normalizedAllowed}: ${outputPath}`);
        }
        return resolved;
      } catch (err) {
        if (err instanceof Error && err.message.includes('Output path must be within')) {
Behavior4/5

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

With no annotations, the description fully discloses behavior: captures three sizes, restores original viewport, and lists possible errors. It covers side effects (viewport restoration) and file naming. No contradictions.

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?

Well-structured, front-loaded with purpose, followed by usage, parameters, and errors. Every sentence adds value with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, description details return format and covers errors. Sufficient for full understanding of tool behavior and output.

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

Parameters4/5

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

Single parameter with 100% schema coverage. Description adds default value and naming convention beyond the schema, enhancing usability.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it captures full-page screenshots at three responsive breakpoints with specific dimensions. It differentiates from sibling tools like pilot_screenshot and pilot_annotated_screenshot by specifying multi-viewport capture.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use: 'preview how a page looks across different screen sizes, test responsive design, or generate viewport comparison screenshots.' Provides behavioral context (viewport restoration) but does not explicitly state when not to use or name alternatives.

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