Skip to main content
Glama

Html Select

html_select
Read-onlyIdempotent

Scrape a public page (SSRF-safe fetch) or an HTML string with a CSS selector (CSS3 plus :has, :contains, :nth-child(an+b), attribute operators) or raw XPath: returns each match's text, attributes and optionally outer HTML, or just one attribute (href / src resolved to absolute URLs). Also returns the XPath the selector compiled to. Like querySelectorAll without a browser. Price: $0.003 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/html-select

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

Input Schema

NameRequiredDescriptionDefault
urlNo
attrNoReturn only this attribute per match (href/src made absolute)
htmlNoHTML source instead of url
limitNo
xpathNoXPath 1.0 expression instead of selector
maxTextNo
selectorNoCSS selector (or use xpath)
outerHtmlNoInclude each match's outer HTML

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/openWorld/idempotent/non-destructive, and the description layers on genuinely useful facts: the fetch is SSRF-safe, href/src are resolved to absolute URLs, the compiled XPath is returned, and billing is $0.003 USDC per successful call via x402 on Solana. It omits truncation behaviour (maxText) and what happens on failed fetches or zero matches, which keeps 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose, selector dialect support, return shape and cost are front-loaded in a tight set of sentences. The trailing HTTPS endpoint string is useful but reads as appended metadata rather than prose, costing a little density.

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?

With 8 optional parameters and no output schema, the description carries the return-value burden well: matches with text/attributes, optional outer HTML, single-attribute mode, and the compiled XPath. The remaining gap is result-size controls (limit, maxText truncation), which an agent needs to predict payload volume.

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 coverage is 63%, so the baseline is 3. The description reinforces the attr/outerHtml/selector-vs-xpath semantics and the absolute-URL resolution, but says nothing about limit (default 50, max 500) or maxText (default 500 characters), so the two parameters that most shape output size are undocumented in both places.

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 (scrape a public page or HTML string with a CSS selector or raw XPath) and names the exact return shape. It is distinguishable from siblings like html_tables, html_to_markdown, readability_extract and xml_xpath, and the 'querySelectorAll without a browser' analogy pins it down precisely.

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?

It makes clear when this tool is the right pick (selector/XPath extraction from live pages or HTML strings) and hints at input alternatives via the url-vs-html parameter pairing. It does not explicitly exclude or route to neighbouring tools such as html_tables for tables, xml_xpath for XML, or web_to_text for readable prose, so there is no explicit when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources