Skip to main content
Glama

analyze_page_structure

Read-onlyIdempotent

Extracts a page's section band map via headless browser from live URLs or local files, so you can compare a reference site against your build and inspect mobile responsive differences.

Instructions

Extract a page's section band map (tag, label, background color, offset, height per band) via a headless browser, plus a conservative scrollMode (always present: document, element, virtual or canvas); virtualRoot appears only with virtual, and note only with canvas; virtualRoot is a label, not a guaranteed selector or replay root. Works on live URLs and file:// paths — use it to compare a reference site's structure against your local build. compare:"mobile" also captures at 390×844 and returns mobileBands + diff {heightDelta, bandsAdded, bandsRemoved, reordered} plus responsive evidence: horizontal overflow, small text and small tap targets. cdpEndpoint instead attaches to a browser you started (AWWWARDS_MCP_ATTACH=1) and scans the already-open matching page: it never navigates, scrolls, clicks or creates tabs.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "analyze_page_structure"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesAbsolute URL (https:// or file://) of the page to analyze
compareNoAlso capture at 390×844 (mobile): adds mobileBands + diff; if the mobile capture fails you still get the desktop result plus mobileError; absent keeps the desktop response unchanged
maxBandsNoCap on returned bands
viewportNodesktop = 1440x900 (default); mobile = 390x844 iPhone-class with deviceScaleFactor 3, isMobile + hasTouchdesktop
publicOnlyNoRefuse private/loopback/metadata destinations and route browser captures through the pinned public-address guard; cannot be combined with cdpEndpoint
cdpEndpointNoAttach to a browser YOU started (requires AWWWARDS_MCP_ATTACH=1): loopback CDP endpoint (http://127.0.0.1:9222, http://[::1]:9222, or ws://127.0.0.1:9222/devtools/browser/<id>; an http endpoint is resolved via /json/version and its ws URL re-validated before connecting). Selects an already-open page whose URL matches exactly - never navigates, scrolls, clicks or creates tabs - and disconnects without closing it. Not available with compare or a non-desktop viewport
waitStrategyNo'load' + settle works on heavy sites; 'networkidle' waits for total quietload

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.18.0
    • changedInput schema / properties / cdpEndpoint / description
      Previous value: -"Attach to a browser YOU started (requires AWWWARDS_MCP_ATTACH=1): loopback CDP endpoint (http://127.0.0.1:9222, http://[::1]:9222, or ws://127.0.0.1:9222/devtools/browser/<id>; an http endpoint is resolved via /json/version and its ws URL re-validated before connecting). Selects an already-open page whose URL matches exactly — never navigates, scrolls, clicks or creates tabs — and disconnects without closing it. Not available with compare or a non-desktop viewport"New value: +"Attach to a browser YOU started (requires AWWWARDS_MCP_ATTACH=1): loopback CDP endpoint (http://127.0.0.1:9222, http://[::1]:9222, or ws://127.0.0.1:9222/devtools/browser/<id>; an http endpoint is resolved via /json/version and its ws URL re-validated before connecting). Selects an already-open page whose URL matches exactly - never navigates, scrolls, clicks or creates tabs - and disconnects without closing it. Not available with compare or a non-desktop viewport"
    • addedInput schema / properties / publicOnly
      Added value: +{
      +  "description": "Refuse private/loopback/metadata destinations and route browser captures through the pinned public-address guard; cannot be combined with cdpEndpoint",
      +  "type": "boolean"
      +}
  2. Changed2 schema fields changedv1.14.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / cdpEndpoint
      Added value: +{
      +  "description": "Attach to a browser YOU started (requires AWWWARDS_MCP_ATTACH=1): loopback CDP endpoint (http://127.0.0.1:9222, http://[::1]:9222, or ws://127.0.0.1:9222/devtools/browser/<id>; an http endpoint is resolved via /json/version and its ws URL re-validated before connecting). Selects an already-open page whose URL matches exactly — never navigates, scrolls, clicks or creates tabs — and disconnects without closing it. Not available with compare or a non-desktop viewport",
      +  "type": "string"
      +}
  3. Changed2 schema fields changedv1.13.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / compare
      Added value: +{
      +  "description": "Also capture at 390×844 (mobile): adds mobileBands + diff; if the mobile capture fails you still get the desktop result plus mobileError; absent keeps the desktop response unchanged",
      +  "enum": [
      +    "mobile"
      +  ],
      +  "type": "string"
      +}
  4. Changed1 schema field changedv1.6.0
    • addedInput schema / properties / viewport
      Added value: +{
      +  "default": "desktop",
      +  "description": "desktop = 1440x900 (default); mobile = 390x844 iPhone-class with deviceScaleFactor 3, isMobile + hasTouch",
      +  "enum": [
      +    "desktop",
      +    "mobile"
      +  ],
      +  "type": "string"
      +}
  5. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive, open-world behavior, yet the description still adds real value: the cdp attach mode 'never navigates, scrolls, clicks or creates tabs' and disconnects without closing, compare mode degrades gracefully, and virtualRoot is explicitly 'a label, not a guaranteed selector or replay root.' It stops short of 5 because it says nothing about timeouts, capture cost, or failure modes outside the mobile-diff case.

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 core purpose is front-loaded before the conditional modes, and the semicolon-delimited clauses each carry distinct information about scrollMode, virtualRoot, compare, and cdpEndpoint. It is dense and would scan better as short bullets, but there is little genuine filler given that no output schema exists.

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 7-parameter tool with no output schema, the description covers return shape, the mobile diff fields, responsive evidence, and the attach-mode constraints, which is most of what an agent needs. Gaps remain around runtime cost, timeout behavior, and what an empty or failed band map looks like when mobileError is not involved.

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 url, compare, cdpEndpoint, viewport, maxBands, publicOnly and waitStrategy. The description's parameter language is largely a restatement, though it does add the downstream consequence of compare (mobileBands plus diff of heightDelta, bandsAdded, bandsRemoved, reordered). That incremental return semantics is useful but modest against a fully documented schema, so the baseline 3 holds with a slight lean upward.

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?

Names a specific verb and resource plus the payload it returns: 'Extract a page's section band map (tag, label, background color, offset, height per band) via a headless browser.' An agent immediately knows this is structural/layout analysis, not accessibility, bundle, or scroll-map analysis. It does not name a specific sibling to contrast with, so it stops short of a 5.

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?

'Works on live URLs and file:// paths — use it to compare a reference site's structure against your local build' gives a concrete when-to-use framing, and the cdpEndpoint paragraph explains the alternate attach workflow. No explicit exclusions against siblings such as analyze_scroll_map or capture_live_site, so it is clear context rather than full routing guidance.

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