reload
Reload the current browser page to refresh content, with options to wait for specific load states and set timeout limits.
Instructions
Reload the current page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| waitUntil | No | ||
| timeout | No | Timeout in milliseconds | |
| tabId | No | Tab ID to operate on (uses active tab if not specified) |
Implementation Reference
- src/tools/navigation.ts:63-89 (handler)The handler function for the 'reload' tool, registered via server.tool. It retrieves the page for the given tabId and calls page.reload() with optional waitUntil and timeout.server.tool( 'reload', 'Reload the current page', reloadSchema.shape, async ({ waitUntil, timeout, tabId }) => { const pageResult = await getPageForOperation(tabId); if (!pageResult.success) { return handleResult(pageResult); } const page = pageResult.data; try { await page.reload({ waitUntil: (waitUntil ?? 'load') as WaitUntilOption, timeout: timeout ?? getDefaultTimeout(), }); return handleResult(ok({ url: page.url(), title: await page.title(), })); } catch (error) { return handleResult(err(normalizeError(error))); } } );
- src/schemas.ts:32-36 (schema)Zod schema defining the input parameters for the reload tool: optional waitUntil, timeout, and tabId.export const reloadSchema = z.object({ waitUntil: waitUntilSchema, timeout: timeoutSchema, tabId: tabIdSchema, });
- src/server.ts:23-23 (registration)Invocation of registerNavigationTools during server setup, which includes registration of the reload tool.registerNavigationTools(server);
- src/tools/navigation.ts:8-18 (registration)Function that registers navigation tools including reload.err, navigationTimeout, navigationFailed, normalizeError, } from '../errors.js'; import type { WaitUntilOption } from '../types.js'; /** * Register navigation tools */ export function registerNavigationTools(server: McpServer): void {