summarize_multiple_urls
Generate concise summaries of multiple web page URLs with AI. Input URLs and customize summarization instructions, format, and length for quick insights.
Instructions
Summarize multiple web page URLs using AI via ReviewWeb.site API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | No | Your ReviewWebsite API key | |
| debug | No | Whether to enable debug mode | |
| delayAfterLoad | No | Optional delay after page load in milliseconds | |
| format | No | Format of the summary (bullet points or paragraph) | |
| instructions | No | Custom instructions for the AI on how to summarize the content | |
| maxLength | No | Maximum length of each summary in words | |
| maxLinks | No | Maximum number of URLs to process | |
| model | No | AI model to use for summarization | |
| systemPrompt | No | Custom system prompt to guide the AI | |
| urls | Yes | List of URLs to summarize |
Implementation Reference
- src/tools/reviewwebsite.tool.ts:774-779 (registration)Registers the MCP tool named 'summarize_multiple_urls' with the server, specifying the description, input schema from types, and the handler function.server.tool( 'summarize_multiple_urls', `Summarize multiple web page URLs using AI via ReviewWeb.site API.`, SummarizeMultipleUrlsToolArgs.shape, handleSummarizeMultipleUrls, );
- src/tools/reviewwebsite.tool.ts:406-454 (handler)The main handler function for the 'summarize_multiple_urls' MCP tool. It logs the call, delegates to the ReviewWebsite controller's summarizeMultipleUrls method, formats the successful response as MCP content block, or returns formatted error./** * @function handleSummarizeMultipleUrls * @description MCP Tool handler to summarize multiple URLs using AI * @param {SummarizeMultipleUrlsToolArgsType} args - Arguments provided to the tool * @returns {Promise<{ content: Array<{ type: 'text', text: string }> }>} Formatted response for the MCP */ async function handleSummarizeMultipleUrls( args: SummarizeMultipleUrlsToolArgsType, ) { const methodLogger = Logger.forContext( 'tools/reviewwebsite.tool.ts', 'handleSummarizeMultipleUrls', ); methodLogger.debug(`Summarizing multiple URLs with options:`, { ...args, api_key: args.api_key ? '[REDACTED]' : undefined, }); try { const result = await reviewWebsiteController.summarizeMultipleUrls( args.urls, { instructions: args.instructions, systemPrompt: args.systemPrompt, model: args.model, delayAfterLoad: args.delayAfterLoad, maxLinks: args.maxLinks, maxLength: args.maxLength, format: args.format, debug: args.debug, }, { api_key: args.api_key, }, ); return { content: [ { type: 'text' as const, text: result.content, }, ], }; } catch (error) { methodLogger.error(`Error summarizing multiple URLs`, error); return formatErrorForMcpTool(error); } }
- Zod schema defining the input arguments for the summarize_multiple_urls tool, including urls array and various optional summarization options./** * Schema for ReviewWebsite summarize multiple URLs tool arguments */ export const SummarizeMultipleUrlsToolArgs = z.object({ urls: z.array(z.string()).describe('List of URLs to summarize'), instructions: z .string() .optional() .describe( 'Custom instructions for the AI on how to summarize the content', ), systemPrompt: z .string() .optional() .describe('Custom system prompt to guide the AI'), model: z.string().optional().describe('AI model to use for summarization'), delayAfterLoad: z .number() .optional() .describe('Optional delay after page load in milliseconds'), maxLinks: z .number() .optional() .describe('Maximum number of URLs to process'), maxLength: z .number() .optional() .describe('Maximum length of each summary in words'), format: z .enum(['bullet', 'paragraph']) .optional() .describe('Format of the summary (bullet points or paragraph)'), debug: z.boolean().optional().describe('Whether to enable debug mode'), api_key: z.string().optional().describe('Your ReviewWebsite API key'), });
- Controller handler that wraps the service call to summarizeMultipleUrls, handles API key, logs, formats response as JSON string, and error handling./** * @function summarizeMultipleUrls * @description Summarize multiple URLs using AI * @memberof ReviewWebsiteController * @param {string[]} urls - URLs to summarize * @param {SummarizeOptions} summarizeOptions - Summarization options * @param {ReviewWebsiteOptions} options - Options including API key * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response * @throws {McpError} Throws an McpError if the service call fails or returns an error */ async function summarizeMultipleUrls( urls: string[], summarizeOptions?: SummarizeOptions, options: ReviewWebsiteOptions = {}, ): Promise<ControllerResponse> { const methodLogger = Logger.forContext( 'controllers/reviewwebsite.controller.ts', 'summarizeMultipleUrls', ); methodLogger.debug('Summarizing multiple URLs', { urls, summarizeOptions }); try { const apiKey = getApiKey(options); const result = await reviewWebsiteService.summarizeMultipleUrls( urls, summarizeOptions, apiKey, ); return { content: JSON.stringify(result, null, 2), }; } catch (error) { return handleControllerError(error, { entityType: 'Summaries', operation: 'creating', source: 'controllers/reviewwebsite.controller.ts@summarizeMultipleUrls', additionalInfo: { urlCount: urls.length }, }); } }