Skip to main content
Glama

read_html

Retrieves the outer HTML of the current page or the first element matching a CSS selector, helping AI agents inspect page structure and extract targeted markup.

Instructions

Outer HTML of the current page, or of the first element matching the CSS selector if given.

Input Schema

NameRequiredDescriptionDefault
selectorNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.46

TDQS

A3.7/5.0
Behavior3/5

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

No annotations, so the description carries the full burden. It does disclose two useful behaviors: omitting the selector returns the whole page, and when a selector is given only the FIRST match is returned. It omits what happens on a non-matching selector (empty result vs. error), whether the call scopes to the top-level document or includes iframes/shadow DOM, and any size limits.

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?

One sentence, front-loaded with the primary return value, with the conditional selector case appended. Nothing 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?

An output schema exists, so return shape needn't be described, and the description covers the main behavioral question (whole page vs. single matched element). The remaining gap is failure/miss semantics, which matters more here because there are no annotations to fall back on.

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 0%, so the description must supply meaning and it largely does: the sole parameter is a CSS selector, it is optional (default yields the full page), and only the first match is used. Missing only a concrete selector syntax example.

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?

States a specific resource and the exact thing returned: the outer HTML of the current page, or of the first element matching the CSS selector. This implicitly separates it from read_text (markup vs. text) without naming that sibling, so an agent can still route correctly but must infer the boundary.

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 only implied: you'd reach for it when you need raw markup rather than extracted text. There is no explicit 'use this instead of read_text when...' guidance and no stated preconditions such as requiring an open page.

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