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); }

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