Skip to main content
Glama

extract_links

Extract web, image, or file links from a webpage URL using ReviewWebsite API. Specify link type, max links, delay, and get HTTP status codes or auto-scrape internal links for detailed data extraction.

Instructions

Extract all links from a HTML content of web page URL using ReviewWeb.site API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoYour ReviewWebsite API key
autoScrapeInternalLinksNoWhether to automatically scrape internal links
debugNoWhether to enable debug mode
delayAfterLoadNoDelay in milliseconds after page load before extracting links
getStatusCodeNoWhether to get HTTP status codes for each link
maxLinksNoMaximum number of links to return
typeNoType of links to extract
urlYesThe target URL to extract links from

Implementation Reference

  • MCP tool handler function for 'extract_links' that validates args, calls the controller, formats response for MCP, and handles errors.
    async function handleExtractLinks(args: ExtractLinksToolArgsType) {
    	const methodLogger = Logger.forContext(
    		'tools/reviewwebsite.tool.ts',
    		'handleExtractLinks',
    	);
    	methodLogger.debug(`Extracting links from URL with options:`, {
    		...args,
    		api_key: args.api_key ? '[REDACTED]' : undefined,
    	});
    
    	try {
    		const result = await reviewWebsiteController.extractLinks(
    			args.url,
    			{
    				type: args.type,
    				maxLinks: args.maxLinks,
    				delayAfterLoad: args.delayAfterLoad,
    				getStatusCode: args.getStatusCode,
    				autoScrapeInternalLinks: args.autoScrapeInternalLinks,
    				debug: args.debug,
    			},
    			{
    				api_key: args.api_key,
    			},
    		);
    
    		return {
    			content: [
    				{
    					type: 'text' as const,
    					text: result.content,
    				},
    			],
    		};
    	} catch (error) {
    		methodLogger.error(`Error extracting links from URL`, error);
    		return formatErrorForMcpTool(error);
    	}
    }
  • Zod schema defining the input parameters for the extract_links tool.
    export const ExtractLinksToolArgs = z.object({
    	url: z.string().describe('The target URL to extract links from'),
    	type: z
    		.enum(['web', 'image', 'file', 'all'])
    		.optional()
    		.describe('Type of links to extract'),
    	maxLinks: z
    		.number()
    		.optional()
    		.describe('Maximum number of links to return'),
    	delayAfterLoad: z
    		.number()
    		.optional()
    		.describe(
    			'Delay in milliseconds after page load before extracting links',
    		),
    	getStatusCode: z
    		.boolean()
    		.optional()
    		.describe('Whether to get HTTP status codes for each link'),
    	autoScrapeInternalLinks: z
    		.boolean()
    		.optional()
    		.describe('Whether to automatically scrape internal links'),
    	debug: z.boolean().optional().describe('Whether to enable debug mode'),
    	api_key: z.string().optional().describe('Your ReviewWebsite API key'),
    });
  • Registration of the 'extract_links' tool with the MCP server, linking name, description, input schema, and handler function.
    server.tool(
    	'extract_links',
    	`Extract all links from a HTML content of web page URL using ReviewWeb.site API.`,
    	ExtractLinksToolArgs.shape,
    	handleExtractLinks,
    );
  • Core service function that performs the HTTP request to the ReviewWeb.site API endpoint /scrape/links-map to extract links.
    async function extractLinks(
    	url: string,
    	options?: ExtractLinksOptions,
    	apiKey?: string,
    ): Promise<any> {
    	const methodLogger = Logger.forContext(
    		'services/vendor.reviewwebsite.service.ts',
    		'extractLinks',
    	);
    
    	try {
    		methodLogger.debug('Extracting links from URL', { url, options });
    
    		const params = new URLSearchParams();
    		params.append('url', url);
    
    		const response = await axios.post(
    			`${API_BASE}/scrape/links-map`,
    			options,
    			{
    				params,
    				headers: getHeaders(apiKey),
    			},
    		);
    
    		methodLogger.debug('Successfully extracted links from URL');
    		return response.data;
    	} catch (error) {
    		return handleApiError(error, 'extractLinks');
    	}
    }
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 the ReviewWeb.site API but doesn't describe key behavioral traits such as rate limits, authentication needs (implied by 'api_key' parameter but not explained), error handling, or what the output looks like. For a tool with 8 parameters and no output schema, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to understand at a glance. Every part of the sentence earns its place by specifying key details like the API used.

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 (8 parameters, no output schema, no annotations), the description is incomplete. It doesn't cover behavioral aspects like authentication, rate limits, or output format, and with no output schema, the agent lacks information on return values. For a tool with this level of complexity, the description should provide more context to be fully helpful.

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?

The input schema has 100% description coverage, meaning all parameters are documented in the schema itself. The description adds no additional meaning beyond the schema, as it doesn't explain parameter interactions, defaults, or usage examples. With high schema coverage, the baseline is 3, reflecting adequate but not enhanced parameter semantics.

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: 'Extract all links from a HTML content of web page URL using ReviewWeb.site API.' It specifies the action (extract links), the resource (HTML content of a web page URL), and the method (using ReviewWeb.site API). However, it doesn't differentiate from sibling tools like 'scrape_url' or 'extract_data', which might have overlapping functionality, so it's not a perfect 5.

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. It doesn't mention sibling tools like 'scrape_url' or 'extract_data', which could be related, and offers no context on prerequisites, exclusions, or specific scenarios for usage. This leaves the agent without clear direction on tool selection.

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