Skip to main content
Glama
eitan3
by eitan3

extract

Fetch a web page and extract structured data by mapping field names to CSS or XPath selectors. Returns first matches or lists for multiple results.

Instructions

Fetch a page and pull structured fields out of it with CSS or XPath selectors.

selectors maps an output field name to a selector. Each value is either:

  • a CSS string, e.g. "h1::text" or "a.product::attr(href)" (returns the first match), or

  • an object: {"css": "...", "all": true} / {"xpath": "//h1/text()", "all": true} ("all": true returns every match as a list; default returns the first match).

Example: {"title": "h1::text", "prices": {"css": ".price::text", "all": true}} Returns {"data": {field: value | [values]}}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
selectorsYes
obey_robotsNo
Behavior4/5

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

With no annotations, the description carries the transparency burden. It explains selector syntax, first-match vs all behavior, and return format. However, it does not disclose the meaning of the obey_robots parameter or potential error handling, leaving some behavioral aspects untold.

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?

The description is well-organized and front-loaded with the main purpose, followed by a compact specification of selector formats and an example. Every section adds necessary value, and formatting uses clear bullet points and code blocks.

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?

The description is largely complete for a complex extraction tool, including return structure and selector behavior. It could be more complete by addressing edge cases, obey_robots semantics, or error handling, but these are secondary to the core extraction logic.

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 description coverage is 0%, so the description must compensate. It does so thoroughly for the selectors parameter, detailing CSS string and object forms with examples. The url parameter is implied by 'Fetch a page.' The obey_robots parameter is not explained, but its name and default null convey partial meaning.

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 clearly states the tool's action: 'Fetch a page and pull structured fields out of it with CSS or XPath selectors.' It specifies the resource (page) and the mechanism (CSS/XPath), distinguishing it from siblings like extract_tables and extract_links which are more specialized.

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 clear context on how to use the tool by explaining the selectors mapping and examples. However, it does not explicitly mention when not to use it or alternatives such as extract_tables or fetch_page, so it falls short of full guidance.

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

Install Server

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/eitan3/Scrapy_MCP_Scraper'

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