Skip to main content
Glama

连接浏览器

browser_connect

Attach to a running Chrome or Edge browser via a debugging port or full WebSocket URL to start a CDP session for console, network, and DOM inspection.

Instructions

附加到已开启调试端口的浏览器实例(或给定完整 WebSocket 地址),建立 CDP 会话。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostNo
portNo调试端口;省略时自动扫描
targetIdNo要切换到的标签页 ID;省略时自动选第一个可用页面
autoAttachNo是否自动附加页面,默认 true
webSocketUrlNo完整 browser WebSocket 地址,优先于 port
watchAllTargetsNo连到浏览器后是否为所有标签页(含之后新开的)都开启抓取,默认 false 只抓当前页

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses only that a CDP session is established; it says nothing about failure modes when no browser is found, whether multiple connects are allowed, or how the session interacts with the many capture/session siblings. For a foundational connectivity tool with zero annotation coverage, this is a substantial gap.

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

Conciseness4/5

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

A single sentence with no wasted words, and the primary case (debug-port browser) is front-loaded ahead of the WebSocket fallback. It is appropriately sized for the action it describes.

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?

With six optional parameters, no output schema, and no annotations, the description is thin for a tool that anchors the whole session workflow. It omits what a successful connection returns and how the established session is consumed by siblings. Adequate but with clear gaps.

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?

Schema coverage is 83% (high), so the schema already documents port, targetId, autoAttach, webSocketUrl, and watchAllTargets. The description reinforces only that webSocketUrl is a full-address alternative, adding marginal meaning beyond the schema. Baseline 3 is appropriate when 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?

States a specific verb (attach/connect) and resource (a browser instance with debug port, or a WebSocket URL) and the outcome (establishing a CDP session). This is clearer than the sibling names alone, but it never distinguishes itself from browser_discover, browser_launch, or browser_close, which an agent must choose between.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase '已开启调试端口' (debug port already open) implies a precondition — the browser must already be running — which is useful context. However, there is no explicit when-to-use guidance and no mention of the alternatives (browser_discover to find, browser_launch to start) that would tell the agent when this tool is the right choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.