Skip to main content
Glama
samirsaci

mcp-webscraper

by samirsaci

extract_data

Scrape webpages and extract specific data using CSS selectors. Configure attributes and JavaScript rendering for dynamic sites.

Instructions

Scrape a webpage and extract specific data using CSS selectors.

Args:
    url: The webpage to scrape
    css_selectors: List of CSS selectors (e.g., ["h1", "a.link", "#content"])
    attributes: List of attributes to extract for each selector (e.g., ["text", "href", "text"])
               If not provided, defaults to "text" for all selectors
    javascript: Set to True for JavaScript-rendered sites

Returns:
    Dictionary with extracted data for each selector

Example:
    extract_data(
        url="https://example.com",
        css_selectors=["h1", "a"],
        attributes=["text", "href"]
    )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
css_selectorsYes
attributesNo
javascriptNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description is the sole source of behavioral info. It reveals that JavaScript rendering can be enabled via parameter, and the return type is a dictionary. However, it does not disclose error handling, rate limiting, origin restrictions, or what happens when selectors find no elements. The example provides some clarity but not comprehensive transparency.

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 a structured docstring with Args, Returns, and Example. It is concise (8 lines) and front-loaded with the purpose. Every sentence adds value, though the example could be slightly shorter. No redundant information.

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?

Given that the tool has 4 parameters and an output schema, the description explains each parameter and the return structure with an example. It lacks details on limitations (e.g., no mention of authentication, timeout, or error handling), but for a standard scraping tool with an output schema, it covers the main aspects well.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must explain each parameter. It describes 'url' as the webpage, 'css_selectors' as list of selectors, 'attributes' as list of attributes to extract (defaults to 'text'), and 'javascript' as a toggle for JS-rendered sites. The example further clarifies usage. This fully compensates for the missing schema descriptions.

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 verb 'scrape' and 'extract', the resource 'webpage', and the method 'using CSS selectors'. It distinguishes from siblings like batch_scrape (multiple pages) and crawl_website (following links) by focusing on a single-page, targeted extraction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus siblings such as batch_scrape, crawl_website, extract_first, or scrape_url. There is no mention of trade-offs, prerequisites, or exclusions. A tool with clear sibling alternatives should explicitly differentiate usage scenarios.

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/samirsaci/mcp-webscraper'

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