uptime_check
Check website availability by performing HTTP uptime checks on URLs. Returns status, HTTP code, and response time in milliseconds.
Instructions
Perform a one-time HTTP uptime check on a URL. Returns whether the site is up or down, HTTP status code, and response time in milliseconds.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Full URL to check (e.g. https://github.com) | |
| timeout | No | Timeout in milliseconds (default: 10000) |
Implementation Reference
- src/tools.ts:301-332 (handler)The implementation of the uptime_check tool, which performs an HTTP availability check on a provided URL.
server.tool( "uptime_check", "Perform a one-time HTTP uptime check on a URL. Returns whether the site is up or down, HTTP status code, and response time in milliseconds.", { url: z.string().describe("Full URL to check (e.g. https://github.com)"), timeout: z .number() .optional() .describe("Timeout in milliseconds (default: 10000)"), }, async ({ url, timeout: checkTimeout }) => { try { const body: Record<string, unknown> = { url }; if (checkTimeout) body.timeout = checkTimeout; const result = await apiPost( "/v1/uptime/check", body, { prefix: "/portal-api", timeout: 30000 } ); return { content: [{ type: "text", text: formatJson(result) }] }; } catch (error) { return { content: [ { type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; }