Skip to main content
Glama

browser_get_dom

Extract security-relevant DOM structure from the current page, including forms, links, scripts, iframes, comments, event handlers, and data attributes, for initial reconnaissance after navigation.

Instructions

Extract security-relevant DOM structure from the current page. Returns data the PROXY CANNOT SEE.

PREREQUISITE: browser_open and browser_go must have been called first.

Automatically extracts:

  • Forms: action URLs, methods, input fields, hidden inputs, CSRF tokens

  • Links: all href values

  • Scripts: src attributes (for finding JS endpoints)

  • Iframes: embedded frame sources

  • HTML comments: developers often leave sensitive info in comments

  • Event handlers: onclick, onsubmit, etc. (for client-side logic)

  • data-* attributes: often contain API endpoints or config values

  • Simplified DOM tree (depth-limited)

Use this for initial recon after navigating to a page.

Args: selector: Root element CSS selector to analyze (default: "body" = entire page) max_depth: How deep to traverse the DOM tree (default: 4). Higher = more detail but more tokens. session_name: Browser session to use (default: "default")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tab_idNo
selectorNobody
max_depthNo
session_nameNodefault

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It lists exactly what is extracted (forms, links, scripts, iframes, comments, event handlers, data-* attributes, simplified DOM tree), explains the effect of max_depth on token usage, and states the prerequisite. This gives a thorough understanding of the tool's behavior without needing to invoke it.

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?

The description is well-organized with clear sections: purpose, prerequisite, extracted items, usage, and args. It is somewhat long but every section adds value, especially the detailed list of extracted data elements. It could be more concise, but the structure enhances readability.

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?

The description covers prerequisites, the exact data extracted, parameter defaults, and a use case. An output schema is present, so return values need not be described. It lacks error-handling details or edge cases (e.g., what happens if selector not found), but for a DOM extraction tool with moderate complexity, it is adequately complete.

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 description coverage is 0%, so the description must compensate. It explains selector (root element CSS selector), max_depth (depth of traversal and token trade-off), and session_name (browser session), but omits tab_id entirely. This is a slight gap, but the provided parameter details go beyond the schema's basic type/default information.

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?

The description clearly states the tool extracts security-relevant DOM structure with a specific verb ('Extract') and resource ('DOM structure from the current page'). It distinguishes from sibling tools like browser_get_text or browser_js by focusing on security-relevant elements such as forms, CSRF tokens, scripts, and comments.

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?

The description explicitly states when to use it ('initial recon after navigating to a page') and provides a prerequisite ('browser_open and browser_go must have been called first'). It also contrasts with the proxy by noting it returns data the proxy cannot see, but it does not name alternative tools or when not to use this tool.

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/BobongKu/nodriver-proxy-mcp'

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