Skip to main content
Glama

pilot_resize

Set the browser viewport width and height in pixels to simulate device screens and test responsive layouts.

Instructions

Set the browser viewport size in pixels to simulate different screen resolutions. Use when the user wants to test responsive layouts, simulate a mobile or tablet screen, or change the visible area of the page. For multi-viewport screenshots, use pilot_responsive instead.

Parameters:

  • width: Viewport width in pixels (e.g., 1280 for desktop, 375 for mobile)

  • height: Viewport height in pixels (e.g., 720 for desktop, 812 for mobile)

Returns: Confirmation with the new viewport dimensions.

Errors: None — any valid pixel dimensions are accepted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthYesViewport width in pixels
heightYesViewport height in pixels

Implementation Reference

  • Registration of the 'pilot_resize' tool with the MCP server. The handler calls bm.setViewport(width, height) to change the browser viewport size and returns a confirmation message.
    export function registerSettingsTools(server: McpServer, bm: BrowserManager) {
      server.tool(
        'pilot_resize',
        `Set the browser viewport size in pixels to simulate different screen resolutions.
    Use when the user wants to test responsive layouts, simulate a mobile or tablet screen, or change the visible area of the page. For multi-viewport screenshots, use pilot_responsive instead.
    
    Parameters:
    - width: Viewport width in pixels (e.g., 1280 for desktop, 375 for mobile)
    - height: Viewport height in pixels (e.g., 720 for desktop, 812 for mobile)
    
    Returns: Confirmation with the new viewport dimensions.
    
    Errors: None — any valid pixel dimensions are accepted.`,
          {
          width: z.number().describe('Viewport width in pixels'),
          height: z.number().describe('Viewport height in pixels'),
        },
        async ({ width, height }) => {
          await bm.ensureBrowser();
          try {
            await bm.setViewport(width, height);
            return { content: [{ type: 'text' as const, text: `Viewport set to ${width}x${height}` }] };
          } catch (err) {
            return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
          }
        }
      );
  • Zod schema defining the 'width' and 'height' parameters for pilot_resize, both required numbers describing viewport dimensions in pixels.
      {
      width: z.number().describe('Viewport width in pixels'),
      height: z.number().describe('Viewport height in pixels'),
    },
  • The setViewport method on BrowserManager delegates to Playwright's page.setViewportSize() to actually change the viewport dimensions.
    // ─── Viewport ──────────────────────────────────────────────
    async setViewport(width: number, height: number) {
      await this.getPage().setViewportSize({ width, height });
    }
  • registerAllTools calls registerSettingsTools which registers pilot_resize, and the tool profile system determines whether it is included (full profile only, not in core or standard).
    export function registerAllTools(server: McpServer, bm: BrowserManager, profile: ToolProfile = 'full'): void {
      const allowed = PROFILE_TOOLS[profile];
      const effectiveServer = allowed ? createFilteredServer(server, allowed) : server;
    
      registerNavigationTools(effectiveServer, bm);
      registerSnapshotTools(effectiveServer, bm);
      registerInteractionTools(effectiveServer, bm);
      registerPageTools(effectiveServer, bm);
      registerInspectionTools(effectiveServer, bm);
      registerVisualTools(effectiveServer, bm);
      registerTabTools(effectiveServer, bm);
      registerSettingsTools(effectiveServer, bm);
      registerIframeTools(effectiveServer, bm);
      registerAutomationTools(effectiveServer, bm);
    }
Behavior4/5

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

Describes the return value and that any valid pixel dimensions are accepted. Lacks mention of potential side effects (e.g., resize affecting current tab only, no zoom change), but sufficient for a simple action.

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?

Brief, well-structured description with separate sections for purpose, usage, parameters, return, and errors. No unnecessary words.

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?

Covers all necessary aspects: purpose, when to use, parameters with examples, return value, error handling, and sibling differentiation. Complete for this simple tool.

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?

Adds example values for desktop and mobile beyond the schema's description, clarifying units and providing context for typical use.

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?

Clearly states the action (set viewport size), resource (browser viewport), and simulation goal. Distinguishes from sibling pilot_responsive by noting the multi-viewport screenshot alternative.

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

Usage Guidelines5/5

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

Explicitly states when to use (responsive testing, simulating screen sizes) and provides an alternative tool for multi-viewport screenshots.

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