Skip to main content
Glama

extract_data_multiple

Transform multiple web page URLs into structured JSON data using AI with the ReviewWebsite API. Define instructions, specify JSON templates, and extract precise data efficiently.

Instructions

Extract structured data (JSON) from multiple web page URLs using AI via ReviewWeb.site API.

Input Schema

NameRequiredDescriptionDefault
api_keyNoYour ReviewWebsite API key
debugNoWhether to enable debug mode
delayAfterLoadNoOptional delay after page load in milliseconds
instructionsYesInstructions for the AI to extract data from the websites
jsonTemplateYesJSON schema template for the extracted data output
modelNoAI model to use for extraction
systemPromptNoSystem prompt for the AI
urlsYesList of URLs to extract data from

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "api_key": { "description": "Your ReviewWebsite API key", "type": "string" }, "debug": { "description": "Whether to enable debug mode", "type": "boolean" }, "delayAfterLoad": { "description": "Optional delay after page load in milliseconds", "type": "number" }, "instructions": { "description": "Instructions for the AI to extract data from the websites", "type": "string" }, "jsonTemplate": { "description": "JSON schema template for the extracted data output", "type": "string" }, "model": { "description": "AI model to use for extraction", "type": "string" }, "systemPrompt": { "description": "System prompt for the AI", "type": "string" }, "urls": { "description": "List of URLs to extract data from", "items": { "type": "string" }, "type": "array" } }, "required": [ "urls", "instructions", "jsonTemplate" ], "type": "object" }

Implementation Reference

  • MCP tool handler that processes the tool arguments, maps them to controller parameters, calls the controller, and formats the MCP response.
    async function handleExtractDataMultiple( args: ExtractDataMultipleToolArgsType, ) { const methodLogger = Logger.forContext( 'tools/reviewwebsite.tool.ts', 'handleExtractDataMultiple', ); methodLogger.debug(`Extracting data from multiple URLs with options:`, { ...args, api_key: args.api_key ? '[REDACTED]' : undefined, }); try { const result = await reviewWebsiteController.extractDataMultiple( args.urls, { instructions: args.instructions, systemPrompt: args.systemPrompt, jsonTemplate: args.jsonTemplate, model: args.model, delayAfterLoad: args.delayAfterLoad, debug: args.debug, }, { api_key: args.api_key, }, ); return { content: [ { type: 'text' as const, text: result.content, }, ], }; } catch (error) { methodLogger.error(`Error extracting data from multiple URLs`, error); return formatErrorForMcpTool(error); } }
  • Zod schema defining the input arguments for the 'extract_data_multiple' tool, including URLs, instructions, JSON template, and options.
    export const ExtractDataMultipleToolArgs = z.object({ urls: z.array(z.string()).describe('List of URLs to extract data from'), instructions: z .string() .describe('Instructions for the AI to extract data from the websites'), jsonTemplate: z .string() .describe('JSON schema template for the extracted data output'), systemPrompt: z.string().optional().describe('System prompt for the AI'), model: z.string().optional().describe('AI model to use for extraction'), delayAfterLoad: z .number() .optional() .describe('Optional delay after page load in milliseconds'), debug: z.boolean().optional().describe('Whether to enable debug mode'), api_key: z.string().optional().describe('Your ReviewWebsite API key'), });
  • Registration of the 'extract_data_multiple' tool on the MCP server, specifying name, description, input schema, and handler function.
    'extract_data_multiple', `Extract structured data (JSON) from multiple web page URLs using AI via ReviewWeb.site API.`, ExtractDataMultipleToolArgs.shape, handleExtractDataMultiple, );
  • Core service function that performs the HTTP POST request to the ReviewWeb.site API endpoint '/extract/urls' to extract data from multiple URLs.
    async function extractDataMultiple( urls: string[], options: ExtractDataOptions, apiKey?: string, ): Promise<any> { const methodLogger = Logger.forContext( 'services/vendor.reviewwebsite.service.ts', 'extractDataMultiple', ); try { methodLogger.debug('Extracting data from multiple URLs', { urls, options, }); const response = await axios.post( `${API_BASE}/extract/urls`, { urls, options, }, { headers: getHeaders(apiKey), }, ); methodLogger.debug('Successfully extracted data from multiple URLs'); return response.data; } catch (error) { return handleApiError(error, 'extractDataMultiple'); } }

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/mrgoonie/reviewwebsite-mcp-server'

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