Skip to main content
Glama

Extract website layout tree

extract_layout
Read-onlyIdempotent

Analyze a webpage's layout by extracting a simplified DOM tree with layout computed styles (flex, grid, sizing, spacing, positioning) and section labels, revealing structural organization.

Instructions

Return a simplified DOM tree of a page (or a subtree) with only layout-relevant computed styles per node (flex/grid, sizing, spacing, positioning) and section labels. Shows how the page is structured, not just its tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesAbsolute http:// or https:// URL to analyze.
maxDepthNoMaximum tree depth to descend.
maxNodesNoMaximum nodes to include.
timeoutMsNoNavigation timeout in milliseconds.
userAgentNoOptional browser user-agent override.
waitUntilNoPage lifecycle event to await before extraction.domcontentloaded
autoScrollNoScroll through the page before extraction to trigger lazy-rendered content.
maxScrollsNoMaximum viewport-sized scroll steps when autoScroll is enabled.
rootSelectorNoSelector for the subtree root.body
viewportWidthNoBrowser viewport width in CSS pixels.
viewportHeightNoBrowser viewport height in CSS pixels.
allowPrivateNetworkNoAllow localhost and private-network URLs. Enable only for trusted sites.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint=false, covering safety and side-effect basics. The description adds output detail (DOM tree, computed styles), but does not disclose behavioral traits like headless rendering, network requests, or lazy-loading effects, which are relevant for an AI agent.

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?

The description is two sentences, front-loaded with the verb and resource, and every clause adds value. The second sentence clarifies the tool's distinct focus on structure rather than tokens, with zero redundancy.

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?

Despite the tool's complexity (12 params) and presence of an output schema, the description provides a sufficient high-level overview of what the tool does and its output shape. It could be improved with explicit usage guidance or browser-behavior notes, but it is not critically incomplete.

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 all 12 parameters are already documented in the schema. The description adds no parameter-specific semantics beyond that, which matches the baseline of 3.

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 uses a specific verb ('Return') and resource ('simplified DOM tree of a page/subtree'), and clearly specifies the content ('layout-relevant computed styles', 'section labels'). It distinguishes from siblings by focusing on layout structure rather than assets or tokens.

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?

The second sentence implies the tool's value ('Shows how the page is structured'), but there is no explicit guidance on when to use it instead of alternatives like analyze_html or inspect_component. No exclusions or when-not-to-use cases are mentioned.

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/blackridder22/PicassoWeb'

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