Skip to main content
Glama

convert_to_markdown

Transform web pages into Markdown format using AI, enabling efficient extraction and conversion of URL content for LLM-friendly integration via ReviewWeb.site API.

Instructions

Convert a URL to Markdown using AI via ReviewWeb.site API. Turn a web page into LLM-friendly content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoYour ReviewWebsite API key
debugNoEnable debug mode for detailed logging
delayAfterLoadNoOptional delay after page load in milliseconds
modelNoAI model to use for conversion
urlYesThe URL to convert to Markdown

Implementation Reference

  • MCP tool handler that processes arguments, calls the controller, and formats response for MCP protocol.
    async function handleConvertToMarkdown(args: ConvertToMarkdownToolArgsType) {
    	const methodLogger = Logger.forContext(
    		'tools/reviewwebsite.tool.ts',
    		'handleConvertToMarkdown',
    	);
    	methodLogger.debug(`Converting URL to Markdown with options:`, {
    		...args,
    		api_key: args.api_key ? '[REDACTED]' : undefined,
    	});
    
    	try {
    		const result = await reviewWebsiteController.convertToMarkdown(
    			args.url,
    			{
    				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 URL to Markdown`, error);
    		return formatErrorForMcpTool(error);
    	}
    }
  • Registration of the 'convert_to_markdown' tool with the MCP server, including name, description, input schema, and handler.
    	'convert_to_markdown',
    	`Convert a URL to Markdown using AI via ReviewWeb.site API.
    	Turn a web page into LLM-friendly content.`,
    	ConvertToMarkdownToolArgs.shape,
    	handleConvertToMarkdown,
    );
  • Zod schema defining the input arguments for the convert_to_markdown tool.
    export const ConvertToMarkdownToolArgs = z.object({
    	url: z.string().describe('The URL 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'),
    	debug: z
    		.boolean()
    		.optional()
    		.describe('Enable debug mode for detailed logging'),
    	api_key: z.string().optional().describe('Your ReviewWebsite API key'),
    });
  • Controller wrapper that manages API key resolution and delegates to service layer.
    async function convertToMarkdown(
    	url: string,
    	convertOptions?: ConvertToMarkdownOptions,
    	options: ReviewWebsiteOptions = {},
    ): Promise<ControllerResponse> {
    	const methodLogger = Logger.forContext(
    		'controllers/reviewwebsite.controller.ts',
    		'convertToMarkdown',
    	);
    
    	methodLogger.debug('Converting URL to Markdown', { url, convertOptions });
    
    	try {
    		const apiKey = getApiKey(options);
    		const result = await reviewWebsiteService.convertToMarkdown(
    			url,
    			convertOptions,
    			apiKey,
    		);
    
    		return {
    			content: JSON.stringify(result, null, 2),
    		};
    	} catch (error) {
    		return handleControllerError(error, {
    			entityType: 'Markdown',
    			operation: 'converting',
    			source: 'controllers/reviewwebsite.controller.ts@convertToMarkdown',
    			additionalInfo: { url },
    		});
    	}
    }
  • Core service function that performs the HTTP POST request to ReviewWeb.site API endpoint /convert/markdown.
    async function convertToMarkdown(
    	url: string,
    	options?: ConvertToMarkdownOptions,
    	apiKey?: string,
    ): Promise<any> {
    	const methodLogger = Logger.forContext(
    		'services/vendor.reviewwebsite.service.ts',
    		'convertToMarkdown',
    	);
    
    	try {
    		methodLogger.debug('Converting URL to Markdown', { url, options });
    
    		const response = await axios.post(
    			`${API_BASE}/convert/markdown`,
    			{
    				url,
    				options,
    			},
    			{
    				headers: getHeaders(apiKey),
    			},
    		);
    
    		methodLogger.debug('Successfully converted URL to Markdown');
    		return response.data;
    	} catch (error) {
    		return handleApiError(error, 'convertToMarkdown');
    	}
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions using AI via an external API, which implies network calls and potential latency, but doesn't specify authentication needs (though 'api_key' is in the schema), rate limits, error handling, or what 'LLM-friendly content' entails. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 appropriately sized with two concise sentences that front-load the core functionality. Every sentence earns its place by stating the action and purpose, though it could be slightly more structured by explicitly mentioning key parameters like 'url' or 'api_key'.

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

Completeness3/5

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

Given the tool's complexity (AI conversion via external API) and lack of annotations or output schema, the description is moderately complete. It covers the what and how but misses details on authentication, error cases, output format, and differentiation from siblings. For a tool with no output schema, it should ideally hint at the return value (e.g., Markdown text), but it's adequate as a minimum viable description.

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 already documents all 5 parameters thoroughly. The description adds no additional meaning about parameters beyond implying the 'url' is the core input. With high schema coverage, the baseline is 3, as the description doesn't compensate with extra context but doesn't need to given the schema's completeness.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Convert a URL to Markdown using AI via ReviewWeb.site API. Turn a web page into LLM-friendly content.' It specifies the verb ('Convert'), resource ('URL'), and method ('using AI via ReviewWeb.site API'), which is clear and specific. However, it doesn't explicitly differentiate from siblings like 'scrape_url' or 'extract_data', which might have overlapping functionality.

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 guidance on when to use this tool versus alternatives. With siblings like 'scrape_url', 'extract_data', and 'summarize_url', there's no indication of when this AI-powered conversion is preferred over other extraction or processing methods. The description lacks any context about use cases or exclusions.

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

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