Skip to main content
Glama

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
NameRequiredDescriptionDefault
waitUntilNo
timeoutNoTimeout in milliseconds
tabIdNoTab ID to operate on (uses active tab if not specified)

Implementation Reference

  • 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))); } } );
  • 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);
  • TypeScript type for go_back input parameters, inferred from the Zod schema.
    export type GoBackInput = z.infer<typeof goBackSchema>;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/andytango/puppeteer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server