reload
Reload the current web page in Puppeteer MCP Server to refresh content, handle dynamic updates, or reset page state for automated browser interactions.
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:67-88 (handler)The handler function that executes the reload tool: gets the page, calls page.reload() with options, returns updated URL and title, handles errors.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: waitUntil, timeout, tabId.export const reloadSchema = z.object({ waitUntil: waitUntilSchema, timeout: timeoutSchema, tabId: tabIdSchema, });
- src/tools/navigation.ts:63-89 (registration)Registration of the 'reload' tool on the MCP server using server.tool(), including name, description, schema, and handler.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/server.ts:23-23 (registration)Top-level call to registerNavigationTools which includes the reload tool registration.registerNavigationTools(server);