Skip to main content
Glama

dom_get_html

Retrieve the inner or outer HTML of the first element matching a selector, capped at a byte limit, to uncover page structure beyond what DOM queries reveal.

Instructions

Get the inner or outer HTML of the first element matching a selector, truncated to a byte budget. Useful for understanding structure you cannot infer from dom_query alone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameNo'main' (default), or a substring of a frame's origin/name.main
innerNoinnerHTML instead of outerHTML.
selectorYesCSS selector.
max_bytesNoTruncate beyond this many characters.
Install Server

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations present, the description carries the behavioral disclosure burden. It does reveal non-obvious behavior: only the first matching element is returned, and the output is truncated. The 'byte budget' wording is slightly inconsistent with the schema's 'characters' description, but the core operation and scoping are transparent.

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 concise sentences with no filler. The operation is front-loaded, and the comparison with dom_query is placed in the second sentence as useful context.

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?

This is a simple read-only tool, the schema covers all parameter details, and the description explains purpose, selector scoping, inner/outer mode, and truncation. Minor gaps around no-match behavior and exact return wrapping remain, but they are not critical for a tool that returns HTML.

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?

All four parameters already have full descriptions in the schema, so the baseline is 3. The description loosely reinforces the inner/outer behavior and truncation, but it does not materially improve parameter understanding, and the byte-budget phrasing conflicts with max_bytes being described in characters.

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?

The description names the specific operation: get the inner or outer HTML of the first element matching a selector, with truncation. It also distinguishes itself from the sibling dom_query by explaining that it is useful when structure cannot be inferred from dom_query alone.

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?

The description provides a practical use case and names dom_query as the alternative to consider. It does not list exclusions or other sibling tools, but the context is clear enough for an agent to choose this tool when raw HTML markup is needed.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dayananda-D/Devcdp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server