Skip to main content
Glama

Inspect page structure

inspect_page
Read-only

Returns a compact, visibility-aware DOM tree with key attributes and short text for a page. Use it to understand page structure without dumping full HTML.

Instructions

Return a compact, visibility-aware DOM tree with useful attributes and short text. Prefer this over dumping document HTML. If the user's visual reference remains ambiguous, stop guessing and use pick_element with an interaction prompt.

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

Input Schema

NameRequiredDescriptionDefault
page_idNoTarget page id from get_pages; omit to use the selected page
max_depthNoDOM tree depth
max_nodesNoHard node limit
include_hiddenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds useful character about the output ('visibility-aware', compact, short text) but says nothing about what happens when max_nodes is hit, whether results are truncated or paginated, or what hidden nodes look like when excluded.

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 sentences, both load-bearing: the first defines the output, the second routes to an alternative. The primary preference is front-loaded and there is 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?

With no output schema, the description must carry the return shape and it does so briefly and accurately. For a read-only, four-parameter inspection tool that is largely sufficient, with truncation and default-hidden behavior the only notable gaps.

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 75% — page_id, max_depth and max_nodes are documented in the schema, leaving only include_hidden bare. The description adds no parameter-level meaning such as depth-cost tradeoffs or what the node limit does to the result, so the high-coverage baseline of 3 applies.

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 names a specific verb and resource — 'Return a compact, visibility-aware DOM tree with useful attributes and short text' — which tells an agent exactly what comes back. It distinguishes itself from raw HTML dumping but never contrasts with the sibling inspect_element, so the boundary for single-element inspection is left implicit.

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?

It gives a positive preference ('Prefer this over dumping document HTML') and an explicit escalation path: when the visual reference stays ambiguous, use pick_element with an interaction prompt. That is real routing guidance, though it omits when to choose inspect_element instead.

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