pilot_cookies
Retrieve browser cookies in JSON format from a persistent Chromium instance to enable AI agents to manage web sessions and handle authentication during automated browsing tasks.
Instructions
Get all cookies as JSON.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/inspection.ts:102-115 (handler)The implementation and registration of the 'pilot_cookies' tool, which fetches cookies from the browser context using Playwright.
server.tool( 'pilot_cookies', 'Get all cookies as JSON.', {}, async () => { await bm.ensureBrowser(); try { const cookies = await bm.getPage().context().cookies(); return { content: [{ type: 'text' as const, text: JSON.stringify(cookies, null, 2) }] }; } catch (err) { return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true }; } } );