Skip to main content
Glama

scrapeDeep

Extract comprehensive web content, including images, using deep scraping techniques with customizable parameters such as scroll depth, image size, and pagination. Output data to a specified directory for thorough analysis.

Instructions

Maximum extraction web scraping (slower but thorough)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
downloadImagesNoWhether to download images locally
maxImagesNoMaximum number of images to extract
maxScrollsNoMaximum number of scroll attempts (default: 20)
minImageSizeNoMinimum width/height for images in pixels
outputNoOutput directory for downloaded images
pagesNoNumber of pages to scrape (if pagination is present)
scrapeImagesNoWhether to include images in the scrape result
scrollDelayNoDelay between scrolls in ms (default: 3000)
urlYesURL of the webpage to scrape

Implementation Reference

  • The main handler function for the scrapeDeep tool. It destructures parameters, sets deep scraping options, calls prysm.scrape, processes and limits the result to fit MCP constraints, and handles errors.
    handler: async (params: ScraperBaseParams): Promise<ScraperResponse> => {
      const { url, maxScrolls = 20, scrollDelay = 3000, pages = 1, scrapeImages = false, 
              downloadImages = false, maxImages = 100, minImageSize = 100, output, imageOutput } = params;
      
      try {
        // Create options object for the scraper
        const options = {
          maxScrolls,
          scrollDelay,
          pages,
          focused: false,
          standard: false,
          deep: true, // Use deep mode for thorough extraction
          scrapeImages: scrapeImages || downloadImages,
          downloadImages,
          maxImages,
          minImageSize,
          output: output || config.serverOptions.defaultOutputDir, // Use configured default if not provided
          imageOutput: imageOutput || config.serverOptions.defaultImageOutputDir // Use configured default if not provided
        };
        
        const result = await prysm.scrape(url, options) as ScraperResponse;
        
        // Limit content size to prevent overwhelming the MCP client
        if (result.content && result.content.length > 0) {
          // Limit the number of content sections
          if (result.content.length > 30) {
            result.content = result.content.slice(0, 30);
            result.content.push("(Content truncated due to size limitations)");
          }
          
          // Limit the size of each content section
          result.content = result.content.map(section => {
            if (section.length > 10000) {
              return section.substring(0, 10000) + "... (truncated)";
            }
            return section;
          });
        }
        
        // Limit the number of images to return
        if (result.images && result.images.length > 30) {
          result.images = result.images.slice(0, 30);
        }
        
        return result;
      } catch (error) {
        console.error(`Error scraping ${url}:`, error);
        // Return a proper error format for MCP
        return {
          title: "Scraping Error",
          content: [`Failed to scrape ${url}: ${error instanceof Error ? error.message : String(error)}`],
          images: [],
          metadata: { error: true },
          url: url,
          structureType: "error",
          paginationType: "none",
          extractionMethod: "none"
        };
      }
    }
  • JSON Schema defining the input parameters for the scrapeDeep tool, including required 'url' and optional scraping options.
    parameters: {
      type: 'object',
      properties: {
        url: {
          type: 'string',
          description: 'URL of the webpage to scrape'
        },
        maxScrolls: {
          type: 'number',
          description: 'Maximum number of scroll attempts (default: 20)'
        },
        scrollDelay: {
          type: 'number',
          description: 'Delay between scrolls in ms (default: 3000)'
        },
        pages: {
          type: 'number',
          description: 'Number of pages to scrape (if pagination is present)'
        },
        scrapeImages: {
          type: 'boolean',
          description: 'Whether to include images in the scrape result'
        },
        downloadImages: {
          type: 'boolean',
          description: 'Whether to download images locally'
        },
        maxImages: {
          type: 'number',
          description: 'Maximum number of images to extract'
        },
        minImageSize: {
          type: 'number',
          description: 'Minimum width/height for images in pixels'
        },
        output: {
          type: 'string',
          description: 'Output directory for general results'
        },
        imageOutput: {
          type: 'string',
          description: 'Output directory for downloaded images'
        }
      },
      required: ['url']
    },
  • src/config.ts:65-71 (registration)
    Registration of the scrapeDeep tool in the main MCP server configuration's tools array.
    tools: [
      scrapeFocused,
      scrapeBalanced, 
      scrapeDeep,
      // analyzeUrl,
      formatResult
    ],
  • Intermediate registration/export of tool definitions including scrapeDeep in tools/index.ts.
    export const toolDefinitions: ToolDefinition[] = [
      scrapeFocused,
      scrapeBalanced,
      scrapeDeep,
      // analyzeUrl,
      formatResult,
    ]; 
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'slower but thorough' which hints at performance and depth, but doesn't disclose critical behavioral traits such as rate limits, authentication needs, error handling, what 'maximum extraction' includes beyond images, or output format. This leaves significant gaps for a tool with 9 parameters and no output schema.

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 single, efficient sentence that front-loads the core purpose ('Maximum extraction web scraping') and adds a key behavioral note ('slower but thorough'). There's no wasted text, though it could be more structured for clarity.

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

Completeness2/5

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

Given the complexity (9 parameters, no annotations, no output schema), the description is inadequate. It doesn't explain what 'maximum extraction' entails beyond images, how results are returned, error conditions, or performance implications. For a web scraping tool with rich parameters, this leaves too much undefined for effective agent use.

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?

Schema description coverage is 100%, so the schema fully documents all 9 parameters. The description adds no specific parameter semantics beyond implying image extraction through 'maximum extraction', but this is already covered in the schema. Baseline 3 is appropriate as the schema does the heavy lifting with no added value from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool performs 'maximum extraction web scraping' which indicates a verb (scraping) and resource (web content), but it's vague about what exactly is extracted beyond images implied by parameters. It distinguishes from siblings by mentioning 'slower but thorough' but doesn't specify how it differs from 'scrapeBalanced' or 'scrapeFocused' in concrete terms.

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 explicit guidance on when to use this tool versus alternatives like 'scrapeBalanced' or 'scrapeFocused'. The phrase 'slower but thorough' implies a trade-off but doesn't specify scenarios where thoroughness is prioritized over speed or what 'thorough' entails compared to sibling tools.

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

Related 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/pinkpixel-dev/prysm-mcp-server'

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