Skip to main content
Glama

browser_html

Retrieve page HTML or the outerHTML of the first element matching a CSS selector, capped by maxChars, to inspect markup or extract specific elements.

Instructions

Return the page HTML (or the outerHTML of the first element matching a CSS selector). Capped at maxChars (default 200000). Use browser_text for human-readable text, browser_elements for a clickable list.

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": "browser_html"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxCharsNoCap on returned HTML (default 200000)
selectorNoOptional CSS selector

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.5.0
    • addedInput schema / properties / maxChars
      Added value: +{
      +  "description": "Cap on returned HTML (default 200000)",
      +  "type": "number"
      +}
  2. First observedv2.0.4

TDQS

A4.6/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it does disclose real traits: output is truncated at maxChars (default 200000), and with a selector only the FIRST matching element's outerHTML is returned. It omits what happens when no element matches, whether it auto-waits for load, and which tab it targets — gaps that matter for a scraping tool.

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 short sentences, front-loaded with what is returned, then the cap constraint, then the disambiguation. No redundant wording; the parenthetical and backticked default make it scannable.

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?

There is no output schema and no annotations, so the description does most of the work and correctly characterizes the return value as HTML text with a size cap. It stops short of covering edge cases (selector not found, page not loaded, target tab), which would be needed for a full 5.

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 would be 3, but the description adds genuine meaning: the selector produces outerHTML (not innerText/innerHTML) of the first match, which materially affects how an agent writes the selector. The maxChars cap context is also restated usefully.

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 ("Return the page HTML") plus a precise variant (outerHTML of the first element matching a CSS selector), which immediately separates it from browser_text and browser_elements. An agent can tell what this returns without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes between three sibling tools: this one for raw HTML, browser_text for human-readable text, browser_elements for a clickable list. The selecting condition for each alternative is named, leaving nothing to inference.

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