browser_launch
Launch a new browser instance to capture screenshots of web pages for automated testing and monitoring purposes.
Instructions
Launch a new browser instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| headless | No | Run browser in headless mode |
Implementation Reference
- src/index.ts:214-232 (handler)Handler function for the 'browser_launch' tool. Closes any existing browser, launches a new Puppeteer browser with the specified headless mode (default true), creates a new page, and returns a success message.case 'browser_launch': { const headless = args?.headless !== false; if (browserState.browser) { await browserState.browser.close(); } browserState.browser = await puppeteer.launch({ headless, args: ['--no-sandbox', '--disable-setuid-sandbox'], }); browserState.page = await browserState.browser.newPage(); return { content: [ { type: 'text', text: 'Browser launched successfully', }, ], }; }
- src/index.ts:93-106 (registration)Tool registration for 'browser_launch' in the list of tools, including description and input schema specifying optional 'headless' boolean parameter.{ name: 'browser_launch', description: 'Launch a new browser instance', inputSchema: { type: 'object', properties: { headless: { type: 'boolean', description: 'Run browser in headless mode', default: true, }, }, }, },