go_back
Navigate back in browser history to return to the previous page, with options to wait for page load events and set timeout limits.
Instructions
Navigate back in browser history
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:92-119 (handler)Complete handler for the 'go_back' tool. Selects the page based on tabId, calls page.goBack with waitUntil and timeout options, handles success with URL, title, and navigated flag, or errors.server.tool( 'go_back', 'Navigate back in browser history', goBackSchema.shape, async ({ waitUntil, timeout, tabId }) => { const pageResult = await getPageForOperation(tabId); if (!pageResult.success) { return handleResult(pageResult); } const page = pageResult.data; try { const response = await page.goBack({ waitUntil: (waitUntil ?? 'load') as WaitUntilOption, timeout: timeout ?? getDefaultTimeout(), }); return handleResult(ok({ url: page.url(), title: await page.title(), navigated: response !== null, })); } catch (error) { return handleResult(err(normalizeError(error))); } } );
- src/schemas.ts:38-42 (schema)Zod object schema defining optional inputs for go_back: waitUntil (enum), timeout (number), tabId (string).export const goBackSchema = z.object({ waitUntil: waitUntilSchema, timeout: timeoutSchema, tabId: tabIdSchema, });
- src/server.ts:23-23 (registration)Top-level registration call that invokes registerNavigationTools(server), thereby registering the go_back tool among navigation tools on the MCP server.registerNavigationTools(server);
- src/schemas.ts:203-203 (schema)TypeScript type for go_back input parameters, inferred from the Zod schema.export type GoBackInput = z.infer<typeof goBackSchema>;