pilot_back
Navigate back to the prior page in the browser's history. Returns the URL after moving back.
Instructions
Navigate back to the previous page in browser history. Use when the user wants to go back to the prior page they visited.
Parameters: (none)
Returns: The URL of the page after navigating back.
Errors:
"No previous page in history": There is nothing to go back to. Use pilot_navigate instead.
Timeout (15s): The previous page took too long to load.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/navigation.ts:57-87 (handler)The actual tool handler for 'pilot_back'. It registers the tool with server.tool(...), uses Zod schema {} (no params), and implements the back navigation logic: uses extension 'back' message if available, otherwise falls back to Puppeteer's page.goBack(). Handles errors with wrapError and failure tracking.
server.tool( 'pilot_back', `Navigate back to the previous page in browser history. Use when the user wants to go back to the prior page they visited. Parameters: (none) Returns: The URL of the page after navigating back. Errors: - "No previous page in history": There is nothing to go back to. Use pilot_navigate instead. - Timeout (15s): The previous page took too long to load.`, {}, async () => { await bm.ensureBrowser(); try { const ext = bm.getExtension(); if (ext) { const res = await bm.extSend<{ url: string }>('back'); return { content: [{ type: 'text' as const, text: `Back → ${res.url}` }] }; } const page = bm.getPage(); await page.goBack({ waitUntil: 'domcontentloaded', timeout: 15000 }); bm.resetFailures(); return { content: [{ type: 'text' as const, text: `Back → ${page.url()}` }] }; } catch (err) { bm.incrementFailures(); return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true }; } } ); - src/tools/navigation.ts:69-69 (schema)The input schema for pilot_back is defined as an empty object {} on line 69, meaning the tool accepts no parameters.
{}, - src/tools/register.ts:39-39 (registration)'pilot_back' is listed in the STANDARD_TOOLS set, marking it as a tool available in the 'standard' and 'full' profiles (but not 'core').
'pilot_back', 'pilot_forward', 'pilot_reload', 'pilot_get', - src/tools/register.ts:77-77 (registration)The registration function registerNavigationTools (which registers pilot_back) is called from registerAllTools, passing the filtered server and browser manager.
registerNavigationTools(effectiveServer, bm);