Skip to main content
Glama

url_is_alive

Verify if a URL is accessible by checking its status using the ReviewWebsite API. Input the URL, set a timeout, and optionally use a proxy to confirm availability.

Instructions

Check if a URL is alive using ReviewWeb.site API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoYour ReviewWebsite API key
proxyUrlNoProxy URL to use for the request
timeoutNoRequest timeout in milliseconds (default: 10000)
urlYesURL to check if it's alive

Implementation Reference

  • The MCP tool handler function `handleIsUrlAlive` that processes tool arguments, calls the controller, and formats the response for MCP.
    async function handleIsUrlAlive(args: UrlIsAliveToolArgsType) {
    	const methodLogger = Logger.forContext(
    		'tools/reviewwebsite.tool.ts',
    		'handleIsUrlAlive',
    	);
    	methodLogger.debug(`Checking if URL is alive with options:`, {
    		...args,
    		api_key: args.api_key ? '[REDACTED]' : undefined,
    	});
    
    	try {
    		const result = await reviewWebsiteController.isUrlAlive(
    			args.url,
    			{
    				timeout: args.timeout,
    				proxyUrl: args.proxyUrl,
    			},
    			{
    				api_key: args.api_key,
    			},
    		);
    
    		return {
    			content: [
    				{
    					type: 'text' as const,
    					text: result.content,
    				},
    			],
    		};
    	} catch (error) {
    		methodLogger.error(`Error checking if URL is alive`, error);
    		return formatErrorForMcpTool(error);
    	}
    }
  • Zod schema defining the input arguments for the `url_is_alive` tool.
    export const UrlIsAliveToolArgs = z.object({
    	url: z.string().describe("URL to check if it's alive"),
    	timeout: z
    		.number()
    		.optional()
    		.describe('Request timeout in milliseconds (default: 10000)'),
    	proxyUrl: z
    		.string()
    		.optional()
    		.describe('Proxy URL to use for the request'),
    	api_key: z.string().optional().describe('Your ReviewWebsite API key'),
    });
  • Registration of the `url_is_alive` MCP tool, specifying name, description, input schema, and handler function.
    	'url_is_alive',
    	`Check if a URL is alive using ReviewWeb.site API.`,
    	UrlIsAliveToolArgs.shape,
    	handleIsUrlAlive,
    );
  • Service-level implementation that performs the actual HTTP GET request to the ReviewWeb.site API `/url/is-alive` endpoint to check if the URL is alive.
    async function isUrlAlive(
    	url: string,
    	options?: UrlIsAliveOptions,
    	apiKey?: string,
    ): Promise<any> {
    	const methodLogger = Logger.forContext(
    		'services/vendor.reviewwebsite.service.ts',
    		'isUrlAlive',
    	);
    
    	try {
    		methodLogger.debug('Checking if URL is alive', { url, options });
    
    		// Build query parameters
    		const params = new URLSearchParams();
    		params.append('url', url);
    
    		if (options?.timeout) {
    			params.append('timeout', options.timeout.toString());
    		}
    
    		if (options?.proxyUrl) {
    			params.append('proxyUrl', options.proxyUrl);
    		}
    
    		const response = await axios.get(`${API_BASE}/url/is-alive`, {
    			params,
    			headers: getHeaders(apiKey),
    		});
    
    		methodLogger.debug('Successfully checked if URL is alive');
    		return response.data;
    	} catch (error) {
    		return handleApiError(error, 'isUrlAlive');
    	}
    }
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