Skip to main content
Glama

inspect_page

Map a web page's interactive elements, headings, forms, links, and images with unique CSS selectors before running sequences or recording videos. Returns text for selector discovery.

Instructions

Inspect a web page and get a structured map of all interactive elements, headings, forms, links, and images — each with a unique CSS selector. Use this BEFORE run_sequence or record_video to discover what elements exist on the page and get reliable selectors. Returns text (not an image), so it is fast and cheap. Costs 1 API request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL to inspect (required if no html)
htmlNoRaw HTML to inspect (required if no url)
widthNoViewport width in pixels (default: 1280)
heightNoViewport height in pixels (default: 720)
cookiesNoCookies to set — array of "name=value" strings or { name, value, domain? } objects
headersNoExtra HTTP headers to send with the request
blockAdsNoBlock advertisements on the page
darkModeNoEmulate dark color scheme (default: false)
injectJsNoCustom JavaScript to execute before inspecting
timeZoneNoOverride browser timezone
bypassCSPNoBypass Content-Security-Policy on the page
injectCssNoCustom CSS to inject before inspecting
mediaTypeNoEmulate CSS media type
userAgentNoOverride the browser User-Agent string
waitUntilNoWhen to consider navigation finished (default: networkidle2)
blockChatsNoBlock live chat widgets
session_idNoInspect the LIVE state of a persistent session (Starter+; create with create_session) instead of a fresh page load. Omit url to inspect the page exactly as the last run_sequence/take_screenshot left it; pass url to navigate within the session first. Ideal for re-perceiving between agent actions.
geolocationNoEmulate geolocation
blockBannersNoHide cookie consent banners (default: false)
authorizationNoAuthorization header value (e.g. "Bearer <token>")
blockRequestsNoURL patterns to block
blockTrackersNoBlock tracking scripts
hideSelectorsNoArray of CSS selectors to hide before inspecting
reducedMotionNoEmulate prefers-reduced-motion
blockResourcesNoResource types to block
includeConsoleNoCapture browser console output (console.log/info/warn/error/debug) and uncaught page errors emitted during page load. Adds a "Console" section to the result — lets you debug the page's runtime behavior, not just its static DOM. Default: false.
viewportDeviceNoDevice preset for viewport emulation (e.g. "iphone_14_pro"). Use list_devices to see all presets.
viewportMobileNoEnable mobile meta viewport emulation
waitForSelectorNoWait for this CSS selector to appear before inspecting
viewportHasTouchNoEnable touch event emulation
deviceScaleFactorNoDevice pixel ratio (default: 1)
navigationTimeoutNoNavigation timeout in ms (default: 25000)
viewportLandscapeNoLandscape orientation

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.17.0
    • changedInput schema / properties / cookies / items / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "domain": {
      -        "type": "string"
      -      },
      -      "name": {
      -        "type": "string"
      -      },
      -      "value": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "name",
      -      "value"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "domain": {
      +        "type": "string"
      +      },
      +      "expirationDate": {
      +        "type": "number"
      +      },
      +      "expires": {
      +        "type": "number"
      +      },
      +      "httpOnly": {
      +        "type": "boolean"
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "path": {
      +        "type": "string"
      +      },
      +      "sameSite": {
      +        "enum": [
      +          "Strict",
      +          "Lax",
      +          "None",
      +          "strict",
      +          "lax",
      +          "no_restriction",
      +          "unspecified"
      +        ],
      +        "type": "string"
      +      },
      +      "secure": {
      +        "type": "boolean"
      +      },
      +      "url": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "value"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / includeConsole
      Added value: +{
      +  "description": "Capture browser console output (console.log/info/warn/error/debug) and uncaught page errors emitted during page load. Adds a \"Console\" section to the result — lets you debug the page's runtime behavior, not just its static DOM. Default: false.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Inspect the LIVE state of a persistent session (Starter+; create with create_session) instead of a fresh page load. Omit url to inspect the page exactly as the last run_sequence/take_screenshot left it; pass url to navigate within the session first. Ideal for re-perceiving between agent actions.",
      +  "type": "string"
      +}
  2. First observedv1.8.1

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does add genuine behavioral traits: the result is text not an image, it is fast and cheap, and it costs 1 API request — useful cost/latency disclosure an agent cannot get elsewhere. Gaps remain: no mention of auth/tier requirements beyond the session_id schema note, and no warning that injectJs/injectCss execute arbitrary code on the page.

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?

Three tight sentences, each earning its place: what it does and returns, when to call it relative to siblings, and its cost profile. Nothing is front-loaded poorly or wasted.

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 33-parameter, no-output-schema tool, the description covers purpose, output shape, sibling ordering, and cost, which is enough for correct invocation given 100% schema coverage. It could say more about session reuse and the risk profile of the injection parameters, but nothing critical is missing.

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% across all 33 parameters, so the schema already documents url/html mutual requirement, viewport, cookies, blocking, and session behavior. The description adds no parameter-level syntax or format detail beyond what the schema provides, which is the baseline 3 case.

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?

States a specific verb (inspect) and resource (web page) and enumerates the exact output contents: interactive elements, headings, forms, links, images, each with a unique CSS selector. This is clearly distinguishable from take_screenshot (image) and observe_page without opening any schema.

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?

Explicitly says to use it BEFORE run_sequence or record_video to discover elements and obtain reliable selectors, which is a real workflow prescription naming alternatives. It stops short of saying when NOT to use it or how it relates to the similarly-scoped observe_page sibling, so it is clear context rather than complete routing.

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