Skip to main content
Glama

browser_resize

Adjust browser window dimensions to specified width and height, enabling precise testing for accessibility compliance and responsive design evaluations.

Instructions

Resize the browser window

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
heightYesHeight of the browser window
widthYesWidth of the browser window

Implementation Reference

  • Defines the browser_resize tool, including schema for width/height inputs and handler that generates code and resizes the viewport using page.setViewportSize.
    const resize = defineTabTool({ capability: 'core', schema: { name: 'browser_resize', title: 'Resize browser window', description: 'Resize the browser window', inputSchema: z.object({ width: z.number().describe('Width of the browser window'), height: z.number().describe('Height of the browser window'), }), type: 'readOnly', }, handle: async (tab, params, response) => { response.addCode(`await page.setViewportSize({ width: ${params.width}, height: ${params.height} });`); await tab.waitForCompletion(async () => { await tab.page.setViewportSize({ width: params.width, height: params.height }); }); }, });
  • src/tools.ts:38-56 (registration)
    Registers browser_resize by spreading tools from common.ts (which exports resize) into the allTools array used by the backend.
    export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...form, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ...verify, ];
  • MCP server backend listTools method that exposes the schema of browser_resize (included in _tools from filteredTools) to MCP clients.
    async listTools(): Promise<mcpServer.Tool[]> { return this._tools.map(tool => toMcpTool(tool.schema)); }

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/JustasMonkev/mcp-accessibility-scanner'

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