Skip to main content
Glama

inspect_page_structure

Map a page’s semantic DOM hierarchy—headers, navigation, sections, headings—up to a chosen depth to diagnose structure and layout issues.

Instructions

Return a clean, readable structural hierarchy of the page DOM focusing on semantic elements (header, nav, main, section, footer, headings) up to max_depth.

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

Input Schema

NameRequiredDescriptionDefault
max_depthNoMax hierarchy depth (default: 4)
root_selectorNoRoot selector to start traversal from (default: "body")
filter_semantic_onlyNoFocus on meaningful semantic nodes (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It says the output is a 'clean, readable' hierarchy but not whether that is text or JSON, whether the page must already be open via open_page, whether traversal is safe/read-only, or how large trees are truncated or paged.

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 front-loaded sentence with the verb and output shape first and the scoping qualifiers after. No filler, though the parenthetical element list is partly redundant with the semantic-filtering parameter.

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 a three-parameter, all-optional, no-output-schema read tool, the description covers what is produced and the two main scope controls. Missing are the return encoding and any prerequisite that a page be open, which matter given the sibling open_page/navigate tools.

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 description coverage is 100%, so the schema already documents max_depth, root_selector, and filter_semantic_only. The description restates depth limiting and semantic filtering but adds no syntax, format, or edge-case meaning beyond the schema, and never mentions root_selector at all.

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?

The description uses a specific verb and resource ('Return a clean, readable structural hierarchy of the page DOM') and narrows the scope to semantic elements up to a depth limit. It doesn't explicitly distinguish itself from close siblings like inspect_page or inspect_element, so an agent still has to infer the boundary.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance, and no alternative is named despite a crowded sibling set of inspection tools (inspect_page, inspect_element, inspect_styles, audit_layout). The semantic-elements focus hints at a use case but never states it as a routing rule.

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