Skip to main content
Glama
ScrapeGraphAI

ScrapeGraph MCP Server

Official

smartcrawler_fetch_results

Read-onlyIdempotent

Retrieve results from an asynchronous web crawling operation by polling with a request ID until completion, providing structured data or markdown content from processed webpages.

Instructions

Retrieve the results of an asynchronous SmartCrawler operation.

This tool fetches the results from a previously initiated crawling operation using the request_id. The crawl request processes asynchronously in the background. Keep polling this endpoint until the status field indicates 'completed'. While processing, you'll receive status updates. Read-only operation that safely retrieves results without side effects.

Args: request_id: The unique request ID returned by smartcrawler_initiate. Use this to retrieve the crawling results. Keep polling until status is 'completed'. Example: 'req_abc123xyz'

Returns: Dictionary containing: - status: Current status of the crawl operation ('processing', 'completed', 'failed') - results: Crawled data (structured extraction or markdown) when completed - metadata: Information about processed pages, URLs visited, and processing statistics Keep polling until status is 'completed' to get final results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
request_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler: Wraps the client method, gets API key from context, creates client, calls smartcrawler_fetch_results on it, handles exceptions by returning error dict.
    def smartcrawler_fetch_results(request_id: str, ctx: Context) -> Dict[str, Any]:
        """
        Retrieve the results of an asynchronous SmartCrawler operation.
    
        This tool fetches the results from a previously initiated crawling operation using the request_id.
        The crawl request processes asynchronously in the background. Keep polling this endpoint until
        the status field indicates 'completed'. While processing, you'll receive status updates.
        Read-only operation that safely retrieves results without side effects.
    
        Args:
            request_id: The unique request ID returned by smartcrawler_initiate. Use this to retrieve the crawling results. Keep polling until status is 'completed'. Example: 'req_abc123xyz'
    
        Returns:
            Dictionary containing:
            - status: Current status of the crawl operation ('processing', 'completed', 'failed')
            - results: Crawled data (structured extraction or markdown) when completed
            - metadata: Information about processed pages, URLs visited, and processing statistics
            Keep polling until status is 'completed' to get final results
        """
        try:
            api_key = get_api_key(ctx)
            client = ScapeGraphClient(api_key)
            return client.smartcrawler_fetch_results(request_id)
        except Exception as e:
            return {"error": str(e)}
  • ScapeGraphClient helper method: Makes GET request to API endpoint /crawl/{request_id}, returns JSON response or raises exception on error.
    def smartcrawler_fetch_results(self, request_id: str) -> Dict[str, Any]:
        """
        Fetch the results of a SmartCrawler operation.
    
        Args:
            request_id: The request ID returned by smartcrawler_initiate
    
        Returns:
            Dictionary containing the crawled data (structured extraction or markdown)
            and metadata about processed pages
    
        Note:
        It takes some time to process the request and returns the results.
        Meanwhile it returns the status of the request.
        You have to keep polling the smartcrawler_fetch_results until the request is complete.
        The request is complete when the status is "completed". and you get results
        Keep polling the smartcrawler_fetch_results until the request is complete.
        """
        endpoint = f"{self.BASE_URL}/crawl/{request_id}"
        
        response = self.client.get(endpoint, headers=self.headers)
    
        if response.status_code != 200:
            error_msg = f"Error {response.status_code}: {response.text}"
            raise Exception(error_msg)
    
        return response.json()
  • FastMCP tool registration decorator that registers the function as the 'smartcrawler_fetch_results' tool.
    def smartcrawler_fetch_results(request_id: str, ctx: Context) -> Dict[str, Any]:
Behavior4/5

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

While annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, the description adds valuable behavioral context beyond annotations: it explains the asynchronous nature of the operation, polling requirements, status tracking, and safe retrieval without side effects. The description doesn't contradict annotations and provides operational details not captured in structured fields.

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 (purpose, usage instructions, Args, Returns) and front-loaded key information. Some repetition of 'Keep polling until status is 'completed'' could be reduced, but overall each sentence adds value. The description is appropriately sized for the tool's complexity.

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?

Given the tool has annotations covering safety profile, an output schema exists (so return values don't need explanation), and the description provides comprehensive parameter semantics and usage guidelines, this description is complete. It covers the asynchronous nature, polling behavior, parameter meaning, and distinguishes from sibling tools - all essential context for proper tool invocation.

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?

With 0% schema description coverage for the single parameter, the description fully compensates by providing comprehensive semantic information: it explains what request_id is ('unique request ID returned by smartcrawler_initiate'), its purpose ('to retrieve the crawling results'), usage guidance ('Keep polling until status is 'completed''), and provides an example ('req_abc123xyz'). This adds significant value beyond the bare 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?

The description clearly states the specific action ('retrieve results'), resource ('asynchronous SmartCrawler operation'), and distinguishes it from sibling tools by explicitly mentioning it fetches results from a previously initiated operation using request_id. It differentiates from smartcrawler_initiate by focusing on result retrieval rather than initiation.

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?

Explicitly states when to use this tool ('to retrieve the results from a previously initiated crawling operation using the request_id') and provides clear alternatives by naming the initiation tool ('smartcrawler_initiate'). It also provides specific usage instructions about polling behavior and when to stop ('Keep polling until status is 'completed'').

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/ScrapeGraphAI/scrapegraph-mcp'

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