Skip to main content
Glama
Rainmen-xia

Chrome Debug MCP Server

by Rainmen-xia

resize_browser

Resize browser windows to specified dimensions using a Chrome Debug MCP Server. Enables precise window adjustment for automation tasks within persistent login sessions.

Instructions

调整浏览器窗口大小

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeYes窗口大小,格式为 'width,height'

Implementation Reference

  • Core implementation of resize_browser tool: parses 'width,height', sets viewport size and browser window bounds using Puppeteer CDP session.
    async resize(size: string): Promise<BrowserActionResult> { return this.doAction(async (page) => { const [width, height] = size.split(",").map(Number); const session = await page.createCDPSession(); await page.setViewport({ width, height }); const { windowId } = await session.send("Browser.getWindowForTarget"); await session.send("Browser.setWindowBounds", { bounds: { width, height }, windowId, }); }); }
  • src/index.ts:218-223 (registration)
    Dispatches resize_browser tool calls to BrowserSession.resize method with input validation.
    case "resize_browser": if (!args?.size) { throw new Error("size参数是必需的"); } result = await this.browserSession.resize(args.size as string); break;
  • Defines the tool name, description, and input schema (size: string in 'width,height' format) for resize_browser in the tools list.
    name: "resize_browser", description: "调整浏览器窗口大小", inputSchema: { type: "object", properties: { size: { type: "string", description: "窗口大小,格式为 'width,height'", }, }, required: ["size"], }, },

Other Tools

Related 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/Rainmen-xia/chrome-debug-mcp'

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