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);
    }
Behavior3/5

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

Annotations indicate readOnlyHint=false, confirming this is a mutation tool, which aligns with the description's 'resizes' action. The description adds context by specifying it affects the 'selected page's window', but doesn't disclose behavioral traits like whether resizing is reversible, impacts page content, or requires specific permissions. With annotations covering the mutation aspect, the description provides minimal additional behavioral insight.

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 description is a single, efficient sentence that front-loads the core action ('Resizes the selected page's window'). It avoids redundancy and wastes no words, though it could be slightly more structured by explicitly mentioning parameters. Overall, it's appropriately sized for the tool's complexity.

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

Completeness3/5

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

Given the tool has 2 parameters with full schema coverage and annotations indicating mutation, the description is minimally adequate. However, without an output schema, it doesn't explain return values or effects, and it lacks context on integration with sibling tools like 'select_page'. For a mutation tool with no output schema, more completeness on behavioral outcomes would be beneficial.

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 input schema has 100% description coverage, with 'width' and 'height' clearly documented as page dimensions. The description adds no extra meaning beyond the schema, merely restating that dimensions are specified. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate with additional details like unit expectations or constraints.

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 'resizes' and the resource 'selected page's window', specifying it changes dimensions. It distinguishes from siblings like 'take_screenshot' or 'navigate_page' by focusing on window resizing, though it doesn't explicitly differentiate from tools like 'emulate_cpu' or 'performance_analyze_insight' that might involve page manipulation. The purpose is specific but could be more precise about the window context.

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. It doesn't mention prerequisites (e.g., needing a selected page via 'select_page'), exclusions, or compare to similar tools like 'emulate_cpu' for performance testing. Usage is implied as part of page manipulation workflows, but explicit context is missing.

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/SHAY5555-gif/chrome-devtools-mcp'

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