woolworths_open_browser
Open a browser to access Woolworths Australia's online shopping platform, enabling product search, specials browsing, cart management, and product detail access through natural language interactions.
Instructions
Opens a browser and navigates to Woolworths website. This is the first step to establish a session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| headless | No | Whether to run browser in headless mode (default: false for easier login) |
Implementation Reference
- src/index.ts:251-289 (handler)The main handler function for 'woolworths_open_browser' tool. Launches Puppeteer browser in specified mode, creates a new page, sets user agent, navigates to Woolworths homepage, and returns success status.async function handleOpenBrowser(args: any): Promise<any> { if (browser) { return { success: false, message: "Browser is already open. Close it first with woolworths_close_browser.", }; } const headless = args.headless ?? false; browser = await puppeteer.launch({ headless, args: [ "--no-sandbox", "--disable-setuid-sandbox", "--disable-blink-features=AutomationControlled", ], defaultViewport: { width: 1280, height: 800 }, }); currentPage = await browser.newPage(); // Set user agent to appear more like a real browser await currentPage.setUserAgent( "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" ); // Navigate to Woolworths homepage await currentPage.goto("https://www.woolworths.com.au", { waitUntil: "networkidle2", }); return { success: true, message: "Browser opened and navigated to Woolworths homepage. You can now log in manually if needed, then use woolworths_get_cookies to capture the session.", url: currentPage.url(), }; }
- src/index.ts:20-34 (schema)The schema definition for the 'woolworths_open_browser' tool, including name, description, and input schema for headless mode.{ name: "woolworths_open_browser", description: "Opens a browser and navigates to Woolworths website. This is the first step to establish a session.", inputSchema: { type: "object", properties: { headless: { type: "boolean", description: "Whether to run browser in headless mode (default: false for easier login)", default: false, }, }, }, },
- src/index.ts:623-625 (registration)The switch case registration that dispatches calls to the 'woolworths_open_browser' handler function within the MCP CallToolRequest handler.case "woolworths_open_browser": result = await handleOpenBrowser(args || {}); break;
- src/index.ts:19-34 (registration)The tool is registered in the TOOLS array used by ListToolsRequestSchema to list available tools.const TOOLS: Tool[] = [ { name: "woolworths_open_browser", description: "Opens a browser and navigates to Woolworths website. This is the first step to establish a session.", inputSchema: { type: "object", properties: { headless: { type: "boolean", description: "Whether to run browser in headless mode (default: false for easier login)", default: false, }, }, }, },