Skip to main content
Glama
scraperapi

scraperapi-mcp-server

Official

ai_parser_create

Generate a reusable AI parser from 1–3 example URLs to extract structured data from pages sharing the same layout. Use for repeatable scraping of similar pages like product listings.

Instructions

Create a reusable AI parser from example URLs.

    Generates a parser that extracts structured data from pages sharing a
    layout. Generation is ASYNCHRONOUS: this returns a parser id and version
    immediately (e.g. {"id": "...", "version": 0}); poll 'ai_parser_get_details' until
    its status is 'FINISHED' before calling 'ai_parser_parse_url'.

    When to use:
    - You want repeatable structured extraction across many similar pages
      (e.g. product pages of one site) and there's no dedicated SDE for it
    - You can provide 1–3 example URLs of the same page type

    When NOT to use:
    - A one-off fetch (use 'scrape') or a supported marketplace/SERP (use the SDE)

    Args:
        params (AiParserCreateParams): name and urls (1–3) are required;
            optional scraper_params (fetch options) and fields (pre-declared
            output schema).

    Returns:
        str: JSON with the new parser's id and version.

    Raises:
        ToolError: If the API key is missing, the rate limit is exceeded, the
            inputs are invalid, or the request fails.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Description explicitly discloses async behavior, polling requirements (status 'FINISHED' before using ai_parser_parse_url), and potential ToolError conditions. Annotations (readOnlyHint=false, destructiveHint=false) align with a creation tool, and the description adds valuable behavioral context beyond annotations.

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?

Well-structured with clear sections (when to use, when not, args, returns, raises). The first sentence is effective. Minor redundancy with schema (Args section) but overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers all aspects: purpose, async workflow, polling, error types, prerequisites (example URLs), and return format. Given the tool's complexity, the description is comprehensive and leaves no critical gaps.

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?

Despite schema description coverage being 0%, the description summarizes the required params (name and urls) and optional ones (scraper_params, fields) with their purposes. This compensates for the schema gap, though the description could include more param-specific details found in the schema.

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?

Description opens with a clear verb and resource: 'Create a reusable AI parser from example URLs.' It further distinguishes from siblings by contrasting with 'scrape' (one-off) and SDE (supported sites). The async nature is highlighted.

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

Usage Guidelines5/5

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

Explicit 'When to use' and 'When NOT to use' sections provide concrete guidance, including alternatives (scrape, SDE) and required polling pattern. Leaves no ambiguity about when to choose this tool.

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/scraperapi/scraperapi-mcp'

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