Skip to main content
Glama

resize_page

Adjust browser window dimensions to specified width and height for responsive design testing and layout verification.

Instructions

Resizes the selected page's window so that the page has specified dimension

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthYesPage width
heightYesPage height

Implementation Reference

  • The handler function for the 'resize_page' tool. It retrieves the selected page from context and resizes it to the specified width and height using the internal page.resize method.
    handler: async (request, response, context) => {
      const page = context.getSelectedPage();
    
      // @ts-expect-error internal API for now.
      await page.resize({
        contentWidth: request.params.width,
        contentHeight: request.params.height,
      });
    
      response.setIncludePages(true);
    },
  • The input schema for the 'resize_page' tool, defining numeric parameters for width and height with descriptions.
    schema: {
      width: z.number().describe('Page width'),
      height: z.number().describe('Page height'),
    },
  • src/main.ts:307-320 (registration)
    The 'resize_page' tool is registered here as part of the pagesTools module (imported via import * as pagesTools from './tools/pages.js'; on line 34). All tools are collected into an array using Object.values and registered via the registerTool function in a loop.
    const tools = [
      ...Object.values(consoleTools),
      ...Object.values(emulationTools),
      ...Object.values(inputTools),
      ...Object.values(networkTools),
      ...Object.values(pagesTools),
      ...Object.values(performanceTools),
      ...Object.values(screenshotTools),
      ...Object.values(scriptTools),
      ...Object.values(snapshotTools),
    ];
    for (const tool of tools) {
      registerTool(tool as unknown as ToolDefinition);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Removedv1.0.0
  2. First observed

TDQS

A3.8/5.0
Behavior3/5

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

The annotations already declare readOnlyHint=false, so the mutation nature is known. The description adds that it resizes the 'window' rather than content, but does not disclose potential side effects (e.g., triggering resize events, requiring page selection, or affecting layout). With annotations present, this is adequate but not rich.

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, front-loaded sentence with no redundant words. It efficiently conveys the tool's purpose without wasting space.

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

Completeness4/5

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

For a simple tool with two parameters, full schema coverage, and an annotation set, the description is mostly sufficient. It lacks units (e.g., pixels) and the prerequisite of selecting a page, but these are minor given the low complexity and presence of sibling tools like select_page.

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% with clear descriptions for width and height ('Page width', 'Page height'). The tool description adds no additional semantic detail beyond 'specified dimension', so it does not exceed the baseline for well-documented schemas.

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 a specific action ('Resizes') and a specific resource ('selected page's window') with an outcome ('so that the page has specified dimension'). It is distinct from all sibling tools, as none other mention resizing.

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

Usage Guidelines3/5

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

The description implies a prerequisite (a 'selected page') but does not explicitly state when to use this tool vs alternatives, nor mention any exclusions or alternative tools. This is implied usage rather than clear guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.