Skip to main content
Glama

read_html

Retrieve the HTML of a page after scripts run, or the outer HTML of a matched CSS selector element, to capture dynamic content.

Instructions

Return the HTML of the current page as it is now (after its scripts ran), or the outer HTML of the first element matching selector. null when no element matches.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "read_html"
  }
}

Input Schema

NameRequiredDescriptionDefault
selectorNoCSS selector of one element; empty for the whole page.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.47-alpha
    • addedInput schema / properties / selector / description
      Added value: +"CSS selector of one element; empty for the whole page."
  2. First observedv0.1.46

TDQS

A3.9/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral burden, and it does well: it discloses that the HTML reflects the post-scripting DOM (not raw source), that only the first matching element is returned, and that `null` signals no match. It omits any note on size/truncation or cross-frame behavior, keeping it short of a 5.

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?

Two compact clauses, front-loaded with the primary return value, and the selector/null edge case immediately after. No filler.

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 single optional-parameter read tool with an output schema, this covers what an agent needs: what is returned, the post-JS timing, first-match semantics, and the null case. Minor omissions around output size or frame context are tolerable given the output schema.

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 coverage is 100%, so baseline is 3, but the description adds real meaning beyond the schema: it clarifies that only the FIRST matching element is returned and that a non-match yields null, which the schema does not state.

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?

Specific verb ('Return') and resource ('HTML of the current page') with two modes of operation spelled out: whole page or outerHTML of the first matching element. It does not name or contrast with the obvious sibling read_text or snapshot, so sibling differentiation is left to the agent.

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?

Usage is implied by the 'as it is now (after its scripts ran)' framing, which tells the agent this returns the post-JS DOM, but there is no explicit when-to-use-this-vs-read_text/snapshot/evaluate guidance and no exclusions or prerequisites.

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