Skip to main content
Glama

browser_dom

Read-onlyIdempotent

Extract structured JSON from page DOM with CSS selectors and field maps, including shadow roots, without executing JavaScript. Scope elements, resolve URLs, and skip empty rows for read-only scraping.

Instructions

Read-only DOM probe & structured JSON extractor (pierces shadow roots, zero eval). Pass 'fields' with 'selector' (e.g. { author: '.user', text: '.body', link: 'a@href', tags: '.tag[]', id: '@data-id' }); '.'=text, '@attr'=attr, '[]'=array. Resolves relative URLs & skips empty rows by default. Use within='' to scope.

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": "browser_dom"
  }
}

Input Schema

NameRequiredDescriptionDefault
allNoInclude ancestor matches for text search.
tabNoTab index string (e.g. '0'), targetId, or URL/title substring.
textNoVisible text substring to match.
exactNoExact text match.
frameNoIframe #fN, id, URL substring, or 'any'.
limitNoMax matches (default 20).
fieldsNoMap of field -> DOM spec ('.', '@attr', '<css>', '<css>@<attr>', '[]').
withinNoContainer CSS scope.
max_textNoMax chars per field (default 90 flat, 800 fields).
selectorNoCSS selector (required with fields).
dedupe_byNoDeduplicate extracted items by this field name.
skip_emptyNoDrop rows where all fields are empty (default true).
resolve_urlsNoResolve relative @href/@src to absolute URLs (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.1

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely new behavior beyond them — shadow-root piercing and the defaults of resolving relative URLs and dropping empty rows — but says nothing about how frames, tabs, or failures surface.

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?

Two front-loaded sentences: identity first, then the field-spec mechanics with an inline example. The parentheticals and stacked shorthands make it dense, but no sentence is wasted and the example earns its length.

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 13 optional parameters and no output schema, the description never states the return shape — rows keyed by field name — even though "skips empty rows" implies it. It covers the fields/within path well but leaves text, exact, tab, frame, limit, dedupe_by and max_text entirely to the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, and the description clears that bar by teaching the field spec mini-language with a concrete worked example (author: '.user', link: 'a@href', tags: '.tag[]', id: '@data-id') plus the '.'/at-attr/'[]' shorthand. That example adds interpretation the schema's terse "'.', '@attr', '<css>'" listing does not.

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?

"Read-only DOM probe & structured JSON extractor" names a specific verb+resource plus two distinguishing traits (pierces shadow roots, zero eval), so the agent knows this is an extraction tool rather than a snapshot or eval tool. It stops short of naming a sibling such as browser_text or browser_snapshot, leaving the boundary to inference.

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?

Usage is implied rather than stated: "zero eval" hints this is the safe alternative to scripted extraction, and "Use within='<css>' to scope" is a parameter tip, not a when-to-use rule. There is no explicit when/when-not or named alternative for plain-text reading versus structured field extraction.

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