Skip to main content
Glama

web_select

Read-only

CSS selector extract from a web page — Fetch a public web page and return every element matching a CSS selector (tag, .class, #id, [attr], [attr=value], descendant and child combinators, :nth-child, :first-child, :not) with its visible text, href/src resolved to absolute URLs, or the value of one attribute (attr=content) or all attributes (attr=*). Scripts and styles are ignored; entities decoded. Optional attr=, text=0 to skip text, limit= (default 50, max 500). Works on server-rendered HTML (no JavaScript execution). Invalid selectors return 400 (not charged). Price: $0.004 USDC (Base, via x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>",
      "selector": "<selector>"
    },
    "name": "web_select"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYeshttps://www.iana.org/help/example-domains
selectorYesa

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, and non-destructive behavior, so the safety profile is covered. The description adds valuable non-obvious behavior: scripts/styles are ignored, entities are decoded, invalid selectors return 400 and are not charged, and the call costs $0.004 USDC. It could say more about pagination or timing, but the added context is strong.

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?

The description is dense and front-loaded: purpose first, then supported selector forms, return behavior, options, constraints, and pricing. It is long but nearly every sentence carries operational information, with only minor overlap in repeating the selector concept.

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 no output schema, the description adequately explains what is returned: matching elements with visible text, resolved href/src URLs, or attribute values. The main completeness gap is the inconsistency between the described attr/text/limit options and the two-property input schema.

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?

It meaningfully explains selector syntax and return shaping with attr=, attr=*, text=0, and limit defaults, which is far richer than the schema's placeholder examples ('a'). However, attr, text, and limit are described as inputs but do not appear in the declared input schema, creating a mismatch that could confuse an agent about what can actually be passed.

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 opens with a specific verb and resource: 'CSS selector extract from a web page'. It immediately clarifies the extraction is selector-based rather than a generic scrape, which distinguishes it from siblings like web_extract and search_web.

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 supplies a clear usage boundary: 'Works on server-rendered HTML (no JavaScript execution)', and notes invalid selectors return 400 without charge. It does not explicitly name an alternative tool for JS-rendered pages or for broader extraction, so it stops short of full when-to-use routing.

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