Skip to main content
Glama

scan_page

Destructive

Inspect the current page as simplified HTML/text, preserving your real browser login state, to get readable content, frame paths, and control locators for automation.

Instructions

Read the current page as simplified HTML/text, preserving login state from the real browser. cutlist collapses long repeated lists and reports a CSS selector for each container it collapsed, derived from that container's own structure. The built-in scan does not write page attributes, ids, or window globals. Optional extra_js runs caller code and can modify the page or send requests. Background tabs may report viewport height zero; ordinary DOM/text/API work still works there, and only visual/layout fidelity requires explicit activate_tab. The result also includes render_state/content_ready when the page can be probed: shell_only or hydrating means the SPA has not produced reliable content yet; retry scan_page or wait_for before treating an empty result as a real empty page. A timed-out built-in readiness probe releases its tab reservation; missing render fields mean readiness is unknown. observation adds current control locators, editability, recommended_tool and reasons; pass a locator unchanged as page_click/page_type selector. Its frames list gives frame paths for another scan_page call, including cross-origin/OOPIF documents. Frame scans are explicit and do not accept extra_js. Top-document extra_js preserves its existing execution semantics and omits actionable metadata. Locators are observations, not persistent refs: re-scan after page changes. verify_coordinate_target means inspect a screenshot before choosing viewport CSS coordinates; it is not an automatic click. upload_files is recommended only for top-document file inputs outside shadow roots; use locator.css as its string selector. Frame/shadow file inputs report no supported upload. max_targets caps controls and frame entries together (0 disables them, maximum 200); truncated=true means more targets or DOM nodes remain uninspected. maxchars caps content separately. Defaults: cutlist=true, maxchars=35000, max_targets=80, timeout=15 seconds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameNo
cutlistNo
timeoutNo
extra_jsNo
maxcharsNo
text_onlyNo
session_idNo
instructionNo
max_targetsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.5.4
    • addedInput schema / properties / frame
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "additionalProperties": true,
      +            "type": "object"
      +          }
      +        ]
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Frame"
      +}
    • addedInput schema / properties / max_targets
      Added value: +{
      +  "default": 80,
      +  "title": "Max Targets",
      +  "type": "integer"
      +}
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

The description goes far beyond the minimal annotations (readOnlyHint false, destructiveHint true). It discloses that the built-in scan does not write page attributes, ids, or window globals, that extra_js can modify the page or send requests, that background tabs may report zero viewport height, that render_state indicates SPA readiness, and that timeout releases the tab reservation. This rich behavioral disclosure directly complements the annotations and adds substantial value.

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 description is long but information-dense, with the core purpose front-loaded. Every sentence adds operational detail (cutlist, frame handling, render_state, locators, upload_files, caps). While it could be slightly tightened (e.g., combining related caveats), the complexity of the tool justifies the length, and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, no required fields, open-world behavior, and an output schema), the description covers a remarkable breadth: it explains render_state readiness, observation locators, frame paths, timeout behavior, max_targets truncation, and edge cases like shadow-root file inputs. It also cross-references sibling tools (wait_for, page_click, page_type) implicitly, making it self-sufficient for an agent to call correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description is the only source for parameter meaning. It explains cutlist, maxchars, max_targets, timeout defaults, extra_js execution semantics, frame handling, and max_targets caps. However, it does not explicitly address text_only, session_id, or instruction, leaving their purpose implicit. Still, it covers the majority of parameters with meaningful semantics.

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 opens with a clear, specific verb-resource statement: 'Read the current page as simplified HTML/text, preserving login state from the real browser.' It distinguishes itself from siblings by detailing unique capabilities (cutlist, observation, frame handling) and does not confuse with other page-reading tools like capture_page_screenshot or execute_js.

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?

The description provides strong contextual guidance: it advises retrying scan_page or using wait_for before treating an empty result as real, notes that frame scans don't accept extra_js, and clarifies that upload_files is only recommended for top-document inputs. However, it does not explicitly name alternative tools (e.g., execute_js) and the conditions that would select them, so it falls short of fully explicit when-to-use-vs-alternatives guidance.

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