Skip to main content
Glama
mcp-browser-dev-tools

mcp-browser-dev-tools

by Hinaser

attach_tab

Attach to a browser tab by URL or targetId to get a snapshot of visible headings and controls with refs, and buffer console and network events for debugging.

Instructions

Start here: attach to a tab by its url, or a targetId from list_tabs or new_tab. Returns the page's snapshot, one line per visible heading and control with a ref such as e12 (f1e3 inside an iframe), and buffers the tab's console and network events from now on. Later calls without sessionId act on the tab attached last.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "attach_tab"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoInstead of targetId: the tab whose URL is this, else the one whose URL contains it.
targetIdNoFrom list_tabs or new_tab.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.4

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the returned snapshot format (one line per visible heading/control), the ref syntax including the iframe variant, and the non-obvious side effect of buffering console and network events from that point on. It does not say whether attaching can trigger navigation or reload, or how the buffer interacts with get_console_messages.

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?

Two dense sentences with the entry-point cue front-loaded, moving from how to attach, to what comes back, to what persists, to default targeting. No filler.

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

Completeness4/5

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

For an annotation-free tool with no output schema, the description covers return shape, ref conventions, and the event-buffering side effect. The remaining gap is the zero-required-parameter case: it never says what attaching with neither url nor targetId does.

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 100%, so the baseline is 3; the description does add mutual-exclusivity ('Instead of targetId') and the substring-matching fallback for url, but those points are already present in the schema property descriptions, so little genuinely new meaning is added.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('attach to a tab') and immediately names the two identification modes (url or targetId). It also distinguishes itself from the sibling tools list_tabs and new_tab by framing itself as the entry point ('Start here') that consumes their output.

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

Usage Guidelines4/5

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

'Start here' establishes call ordering relative to the tab-listing and tab-creating siblings, and the last sentence explains the default-target rule for subsequent calls. It stops short of stating any when-not conditions or what happens if neither url nor targetId is supplied.

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