Skip to main content
Glama
Rainmen-xia

Chrome Debug MCP Server

by Rainmen-xia

click

Simulate mouse clicks at specific coordinates in Chrome for browser automation and testing. Use this tool to interact with web elements programmatically through the Chrome Debug MCP Server.

Instructions

在指定坐标位置点击

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coordinateYes点击位置的坐标,格式为 'x,y'

Implementation Reference

  • The core handler implementation for the 'click' tool. It uses doAction wrapper and handleMouseInteraction helper to perform the mouse click at the given coordinate via Puppeteer page.mouse.click.
     */
    async click(coordinate: string): Promise<BrowserActionResult> {
    	return this.doAction(async (page) => {
    		await this.handleMouseInteraction(page, coordinate, async (x, y) => {
    			await page.mouse.click(x, y);
    		});
    	});
    }
  • The input schema for the 'click' tool, defining the required 'coordinate' parameter as a string in 'x,y' format.
    	name: "click",
    	description: "在指定坐标位置点击",
    	inputSchema: {
    		type: "object",
    		properties: {
    			coordinate: {
    				type: "string",
    				description: "点击位置的坐标,格式为 'x,y'",
    			},
    		},
    		required: ["coordinate"],
    	},
    },
  • src/index.ts:189-194 (registration)
    The dispatching logic in the MCP tool call handler that validates the input and calls the browserSession.click method.
    case "click":
    	if (!args?.coordinate) {
    		throw new Error("coordinate参数是必需的");
    	}
    	result = await this.browserSession.click(args.coordinate as string);
    	break;
  • Helper method used by 'click' (and hover) to handle mouse interactions, including network activity monitoring and post-click navigation waiting.
    private async handleMouseInteraction(
    	page: Page,
    	coordinate: string,
    	action: (x: number, y: number) => Promise<void>,
    ): Promise<void> {
    	const [x, y] = coordinate.split(",").map(Number);
    
    	// 设置网络请求监控
    	let hasNetworkActivity = false;
    	const requestListener = () => {
    		hasNetworkActivity = true;
    	};
    	page.on("request", requestListener);
    
    	// 执行鼠标操作
    	await action(x, y);
    	this.currentMousePosition = coordinate;
    
    	// 小延迟检查操作是否触发了任何网络活动
    	await delay(100);
    
    	if (hasNetworkActivity) {
    		// 如果检测到网络活动,等待导航/加载
    		await page
    			.waitForNavigation({
    				waitUntil: ["domcontentloaded", "networkidle2"],
    				timeout: 15000,
    			})
    			.catch(async () => {
    				// 如果networkidle2失败,尝试仅等待domcontentloaded
    				console.log("鼠标交互后网络静默等待失败,尝试仅等待DOM");
    				await page.waitForNavigation({
    					waitUntil: ["domcontentloaded"],
    					timeout: 15000,
    				}).catch(() => {
    					// 如果还是失败,就忽略,继续执行
    					console.log("鼠标交互后导航等待失败,继续执行");
    				});
    			});
    		await this.waitTillHTMLStable(page);
    	}
    
    	// 清理监听器
    	page.off("request", requestListener);
    }
  • src/index.ts:309-310 (registration)
    Success message generation for the 'click' tool in the response builder.
    case "click":
    	return `✅ 点击操作完成${result.currentMousePosition ? ` (位置: ${result.currentMousePosition})` : ""}`;
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action (click) but doesn't disclose behavioral traits like what happens after clicking (e.g., page navigation, element interaction), error conditions, or dependencies (e.g., requires an active browser session). This leaves significant gaps for a mutation tool.

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 sentence with zero waste. It's front-loaded with the core action and target, making it easy to parse. Every word earns its place without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation action with no annotations and no output schema), the description is incomplete. It doesn't cover what the click does (e.g., triggers UI events), potential side effects, or response format. For a tool that performs an interactive operation, more context is needed.

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 description adds minimal meaning beyond the input schema. Schema description coverage is 100%, with the parameter 'coordinate' documented as '点击位置的坐标,格式为 'x,y''. The description implies coordinate usage but doesn't provide additional context like coordinate system origin or valid ranges. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action (click) and target (specified coordinate position). It uses a specific verb+resource pattern, though it doesn't explicitly distinguish from sibling tools like 'hover' which might be similar. The purpose is unambiguous but lacks sibling differentiation.

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. It doesn't mention prerequisites (e.g., browser must be launched), exclusions, or comparisons to similar tools like 'hover'. The agent must infer usage from context alone.

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