browser_navigate_back
Navigate back to the previous page in browser automation workflows using Playwright MCP's structured accessibility snapshots.
Instructions
Go back to the previous page
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "browser_navigate_back"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/navigate.ts:60-73 (handler)The handler function for the 'browser_navigate_back' tool. It ensures a tab exists, calls `page.goBack()` to navigate back, generates corresponding Playwright code snippet, and returns it with snapshot and network wait instructions.
handle: async context => { const tab = await context.ensureTab(); await tab.page.goBack(); const code = [ `// Navigate back`, `await page.goBack();`, ]; return { code, captureSnapshot, waitForNetwork: false, }; }, - src/tools/navigate.ts:52-58 (schema)The schema definition for the 'browser_navigate_back' tool, including name, title, description, empty input schema using Zod, and 'readOnly' type.
schema: { name: 'browser_navigate_back', title: 'Go back', description: 'Go back to the previous page', inputSchema: z.object({}), type: 'readOnly', }, - src/tools/navigate.ts:100-104 (registration)Registers the 'browser_navigate_back' tool (via goBack) in the array exported by the navigate module, which is later imported and spread into main tool lists.
export default (captureSnapshot: boolean) => [ navigate(captureSnapshot), goBack(captureSnapshot), goForward(captureSnapshot), ]; - src/tools.ts:43-43 (registration)Includes the navigate tools module (containing 'browser_navigate_back') in the snapshotTools array.
...navigate(true), - src/tools.ts:61-61 (registration)Includes the navigate tools module (containing 'browser_navigate_back') in the visionTools array.
...navigate(false),