Skip to main content
Glama
Rainmen-xia

Chrome Debug MCP Server

by Rainmen-xia

resize_browser

Adjust browser window dimensions for testing responsive web designs or capturing screenshots at specific resolutions.

Instructions

调整浏览器窗口大小

Input Schema

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

Implementation Reference

  • Core implementation of resize_browser tool: parses 'width,height' string, sets page viewport, and resizes the browser window using CDP Browser domain commands.
    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:140-153 (registration)
    Tool registration in listTools handler, including name, description, and input schema definition.
    {
    	name: "resize_browser",
    	description: "调整浏览器窗口大小",
    	inputSchema: {
    		type: "object",
    		properties: {
    			size: {
    				type: "string",
    				description: "窗口大小,格式为 'width,height'",
    			},
    		},
    		required: ["size"],
    	},
    },
  • Dispatch handler in CallToolRequestSchema that validates input and calls BrowserSession.resize().
    case "resize_browser":
    	if (!args?.size) {
    		throw new Error("size参数是必需的");
    	}
    	result = await this.browserSession.resize(args.size as string);
    	break;
  • Helper function providing success message for resize_browser tool.
    case "resize_browser":
    	return "✅ 浏览器窗口大小调整完成";
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While '调整浏览器窗口大小' implies a mutation action, it doesn't specify whether this requires a browser to be already launched, what happens if the browser isn't open, whether the size change is immediate or animated, or if there are any constraints on valid dimensions. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient phrase ('调整浏览器窗口大小') that directly communicates the core function without any unnecessary words. It's perfectly front-loaded and every element earns its place.

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's moderate complexity (a mutation action with one parameter) and the absence of both annotations and an output schema, the description is minimally adequate but incomplete. It states what the tool does but lacks crucial context about behavioral aspects, usage prerequisites, and expected outcomes, which would be important for an AI agent to use it correctly.

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 the single parameter 'size' clearly documented as '窗口大小,格式为 'width,height''. The description doesn't add any additional meaning beyond what the schema already provides about parameters, so it meets the baseline score when schema coverage is high.

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 ('调整' meaning adjust/resize) and resource ('浏览器窗口' meaning browser window), making the purpose immediately understandable. However, it doesn't specifically differentiate from sibling tools like 'launch_browser' or 'close_browser' beyond the obvious action difference, so it doesn't reach the highest level of sibling distinction.

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. There's no mention of prerequisites (like needing an active browser session), when-not-to-use scenarios, or how it relates to sibling tools such as 'launch_browser' (which might create the window) or 'close_browser' (which terminates it).

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

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