# get_document

Retrieve the DOM document structure with configurable depth and shadow DOM access. Fetches the document tree starting from the root element, with control over traversal depth and shadow DOM boundary crossing. This provides the foundation for all DOM inspection operations by establishing the document structure. The depth parameter controls how deep into the DOM tree to traverse, while the pierce option enables inspection of shadow DOM content that would normally be encapsulated. Args: depth: Maximum depth to retrieve from document root (default: 1). Use -1 to retrieve the entire document tree. Higher depths provide more complete structure but increase response size. pierce: Whether to traverse shadow DOM boundaries (default: False). When True, includes shadow DOM content in the tree structure. Returns: Document structure dictionary containing: - success: Boolean indicating retrieval success - message: Summary of document structure retrieved - data: Complete DOM tree structure from the document root, including all child elements up to the specified depth Note: Large documents with high depth settings may produce substantial responses. Consider using moderate depths for initial exploration, then targeting specific areas for detailed analysis.

Agent View of the PolicyLayer registry record for `get_document`. HTML page: https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-document

## Facts

- Tool: `get_document`
- Server: Chrome Devtools (`benjaminr/chrome-devtools-mcp`) — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp.md
- Homepage: https://github.com/benjaminr/chrome-devtools-mcp
- Risk category: Read (Low risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Allowed

## Example call (MCP tools/call, JSON-RPC 2.0)

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

## Why get_document is rated Low

This tool retrieves and reads DOM structure information without side effects. While it operates within a browser context (Chrome DevTools), it only fetches and returns data about the page structure. It does not execute code, modify content, delete anything, or trigger external operations.

From the tool's own definition: "The tool 'Retrieve the DOM document structure' with 'configurable depth and shadow DOM access' performs inspection and retrieval operations only."

Risk signals: Bulk/mass operation — affects multiple targets · Admin/system-level operation

## Use case

AI agents call get_document to retrieve information from Chrome Devtools without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Chrome Devtools:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "get_document": {}
  }
}
```

## Other tools on Chrome Devtools (46)

- `clear_all_cookies` — Destructive — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/clear-all-cookies.md
- `clear_storage_for_origin` — Destructive — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/clear-storage-for-origin.md
- `clear_console` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/clear-console.md
- `connect_to_browser` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/connect-to-browser.md
- `evaluate_in_all_frames` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/evaluate-in-all-frames.md
- `execute_javascript` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/execute-javascript.md
- `focus_element` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/focus-element.md
- `inspect_console_object` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/inspect-console-object.md
- `navigate_to_url` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/navigate-to-url.md
- `override_storage_quota` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/override-storage-quota.md
- `start_chrome` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/start-chrome.md
- `start_chrome_and_connect` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/start-chrome-and-connect.md
- `start_css_coverage_tracking` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/start-css-coverage-tracking.md
- `track_indexeddb` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/track-indexeddb.md
- `disconnect_from_browser` — Other — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/disconnect-from-browser.md
- `collect_css_class_names` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/collect-css-class-names.md
- `describe_element` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/describe-element.md
- `get_all_cookies` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-all-cookies.md
- `get_background_colors` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-background-colors.md
- `get_computed_styles` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-computed-styles.md
- `get_connection_status` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-connection-status.md
- `get_console_error_summary` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-console-error-summary.md
- `get_console_logs` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-console-logs.md
- `get_cookies` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-cookies.md
- `get_element_at_position` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-element-at-position.md
- `get_element_attributes` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-element-attributes.md
- `get_element_box_model` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-element-box-model.md
- `get_element_outer_html` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-element-outer-html.md
- `get_inline_styles` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-inline-styles.md
- `get_matched_styles` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-matched-styles.md
- …and 16 more: https://policylayer.com/tools/benjaminr-chrome-devtools-mcp.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=benjaminr-chrome-devtools-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/benjaminr-chrome-devtools-mcp
