Skip to main content
Glama

get_html

Fetch the HTML of a page or element, using a CSS selector to narrow results and avoid output caps. Password field values are automatically blanked.

Instructions

Get HTML of the page or an element. Output is capped (see maxBytes) and cut at a tag boundary; narrow it with selector rather than raising the cap when you can. Password field values are always blanked.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoElement ref from a snapshot
outerNo
tabIdNoTab id (default: active tab)
frameIdNoFrame id from frames_list
maxBytesNoCap returned content at N UTF-8 bytes (default 262144); the full payload still lands in results/
selectorNoCSS selector (or pass ref)
allFramesNoAct on the first match in ANY frame (the element may be in an iframe)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.9.5
    • changedInput schema / properties / allFrames / description
      Previous value: -"Search every frame of the tab and act on the first that matches - use when a selector should match but does not (the element is in an iframe)"New value: +"Act on the first match in ANY frame (the element may be in an iframe)"
    • changedInput schema / properties / frameId / description
      Previous value: -"Act inside this frame (ids come from frames_list)"New value: +"Frame id from frames_list"
    • changedInput schema / properties / maxBytes / description
      Previous value: -"Cap the returned content at this many UTF-8 bytes (default 262144). A truncated result reports truncated/totalBytes/returnedBytes. The full payload is still written to the task's results/ dir."New value: +"Cap returned content at N UTF-8 bytes (default 262144); the full payload still lands in results/"
    • changedInput schema / properties / ref / description
      Previous value: -"Element ref from a prior read (exactly one of selector|ref)"New value: +"Element ref from a snapshot"
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector (exactly one of selector|ref)"New value: +"CSS selector (or pass ref)"
    • changedInput schema / properties / tabId / description
      Previous value: -"Target tab id (defaults to the active tab)"New value: +"Tab id (default: active tab)"
  2. Changed3 schema fields changedv0.7.0
    • addedInput schema / properties / allFrames
      Added value: +{
      +  "description": "Search every frame of the tab and act on the first that matches - use when a selector should match but does not (the element is in an iframe)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / frameId
      Added value: +{
      +  "description": "Act inside this frame (ids come from frames_list)",
      +  "type": "number"
      +}
    • addedInput schema / properties / maxBytes
      Added value: +{
      +  "description": "Cap the returned content at this many UTF-8 bytes (default 262144). A truncated result reports truncated/totalBytes/returnedBytes. The full payload is still written to the task's results/ dir.",
      +  "type": "number"
      +}
  3. First observedv0.6.2

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the disclosure burden. It reveals output truncation at tag boundaries, the maxBytes cap, and password field blanking—behaviors beyond what the input schema states. It does not mention read-only nature or auth, but for a fetch operation this is a solid level of transparency.

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 sentences with no waste: purpose first, then practical guidance, then a privacy-relevant warning. Each sentence earns its place and is front-loaded with the most important information.

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?

Covers core behavior for a 7-parameter tool with no annotations and no output schema: purpose, cap behavior, selector advice, and password masking. It omits explicit output format and how to choose between page vs element targeting, but the raw-HTML return is intuitive and schema descriptions cover most parameters.

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 86%, so parameters are mostly documented. The description adds semantic value by relating selector and maxBytes ('narrow it with selector rather than raising the cap'), but it offers no clarification for outer and doesn't enrich the meaning of ref, tabId, frameId, or allFrames beyond schema text.

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 and resource: retrieving HTML of a page or an element. This clearly distinguishes it from sibling tools like get_text, snapshot, or read_as_markdown, which produce different representations.

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?

Provides actionable usage guidance ('narrow it with selector rather than raising the cap when you can') but does not explicitly say when to choose this tool over siblings like get_text or snapshot. The intended context is implied rather than explicitly contrasted.

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