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
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | No | Your ReviewWebsite API key | |
| proxyUrl | No | Proxy URL to use for the request | |
| timeout | No | Request timeout in milliseconds (default: 10000) | |
| url | Yes | URL to check if it's alive |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"api_key": {
"description": "Your ReviewWebsite API key",
"type": "string"
},
"proxyUrl": {
"description": "Proxy URL to use for the request",
"type": "string"
},
"timeout": {
"description": "Request timeout in milliseconds (default: 10000)",
"type": "number"
},
"url": {
"description": "URL to check if it's alive",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}
Implementation Reference
- src/tools/reviewwebsite.tool.ts:462-496 (handler)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'), });
- src/tools/reviewwebsite.tool.ts:783-787 (registration)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'); } }