Skip to main content
Glama

convert_multiple_to_markdown

Transform multiple web page URLs into Markdown format using AI to create LLM-friendly content. Streamline content extraction and conversion for web pages via ReviewWebsite API.

Instructions

Convert multiple URLs to Markdown using AI via ReviewWeb.site API. Turn multiple web pages into LLM-friendly content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoYour ReviewWebsite API key
debugNoWhether to enable debug mode
delayAfterLoadNoOptional delay after page load in milliseconds
maxLinksNoMaximum number of URLs to process
modelNoAI model to use for conversion
urlsYesList of URLs to convert to Markdown

Implementation Reference

  • The MCP tool handler function that executes the tool logic: extracts arguments, calls the controller method, formats the response for MCP protocol, and handles errors.
    async function handleConvertMultipleToMarkdown( args: ConvertMultipleToMarkdownToolArgsType, ) { const methodLogger = Logger.forContext( 'tools/reviewwebsite.tool.ts', 'handleConvertMultipleToMarkdown', ); methodLogger.debug(`Converting multiple URLs to Markdown with options:`, { ...args, api_key: args.api_key ? '[REDACTED]' : undefined, }); try { const result = await reviewWebsiteController.convertMultipleToMarkdown( args.urls, { 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 converting multiple URLs to Markdown`, error); return formatErrorForMcpTool(error); } }
  • Zod schema defining the input arguments for the convert_multiple_to_markdown tool.
    export const ConvertMultipleToMarkdownToolArgs = z.object({ urls: z.array(z.string()).describe('List of URLs to convert to Markdown'), model: z.string().optional().describe('AI model to use for conversion'), delayAfterLoad: z .number() .optional() .describe('Optional delay after page load in milliseconds'), maxLinks: z .number() .optional() .describe('Maximum number of URLs to process'), debug: z.boolean().optional().describe('Whether to enable debug mode'), api_key: z.string().optional().describe('Your ReviewWebsite API key'), });
  • Registration of the MCP tool with the server, including name, description, input schema, and handler function.
    server.tool( 'convert_multiple_to_markdown', `Convert multiple URLs to Markdown using AI via ReviewWeb.site API. Turn multiple web pages into LLM-friendly content.`, ConvertMultipleToMarkdownToolArgs.shape, handleConvertMultipleToMarkdown, );
  • Service function that makes the actual HTTP API call to ReviewWeb.site to convert multiple URLs to Markdown.
    async function convertMultipleToMarkdown( urls: string[], options?: ConvertToMarkdownOptions, apiKey?: string, ): Promise<any> { const methodLogger = Logger.forContext( 'services/vendor.reviewwebsite.service.ts', 'convertMultipleToMarkdown', ); try { methodLogger.debug('Converting multiple URLs to Markdown', { urls, options, }); const response = await axios.post( `${API_BASE}/convert/markdown/urls`, { urls, options, }, { headers: getHeaders(apiKey), }, ); methodLogger.debug('Successfully converted multiple URLs to Markdown'); return response.data; } catch (error) { return handleApiError(error, 'convertMultipleToMarkdown'); } }
  • Controller function that orchestrates the service call, handles API key, and formats the response.
    async function convertMultipleToMarkdown( urls: string[], convertOptions?: ConvertToMarkdownOptions, options: ReviewWebsiteOptions = {}, ): Promise<ControllerResponse> { const methodLogger = Logger.forContext( 'controllers/reviewwebsite.controller.ts', 'convertMultipleToMarkdown', ); methodLogger.debug('Converting multiple URLs to Markdown', { urls, convertOptions, }); try { const apiKey = getApiKey(options); const result = await reviewWebsiteService.convertMultipleToMarkdown( urls, convertOptions, apiKey, ); return { content: JSON.stringify(result, null, 2), }; } catch (error) { return handleControllerError(error, { entityType: 'Markdown', operation: 'converting multiple', source: 'controllers/reviewwebsite.controller.ts@convertMultipleToMarkdown', additionalInfo: { urlCount: urls.length }, }); } }

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