pilot_resize
Adjust browser viewport dimensions to test responsive design or simulate different screen sizes by specifying width and height in pixels.
Instructions
Set the browser viewport size.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | Viewport width in pixels | |
| height | Yes | Viewport height in pixels |
Implementation Reference
- src/tools/settings.ts:22-30 (handler)The handler implementation for the 'pilot_resize' tool, which sets the browser viewport size using the BrowserManager instance.
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 }; } } - src/tools/settings.ts:15-21 (registration)Registration of the 'pilot_resize' tool with its schema definition using Zod.
server.tool( 'pilot_resize', 'Set the browser viewport size.', { width: z.number().describe('Viewport width in pixels'), height: z.number().describe('Viewport height in pixels'), },