get_cookies
Retrieve all cookies from the current web page for debugging and analysis purposes. This tool helps developers inspect cookie data during web development workflows.
Instructions
Obtém todos os cookies da página atual
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/browserTools.ts:551-565 (handler)The handler function `handleGetCookies` that executes the tool logic by fetching all cookies from the current Puppeteer page using `page.cookies()` and returning them as a formatted JSON string in a ToolResponse./** * Handler para a ferramenta get_cookies */ export async function handleGetCookies(currentPage: Page): Promise<ToolResponse> { const cookies = await currentPage.cookies(); return { content: [ { type: 'text', text: JSON.stringify(cookies, null, 2), }, ], }; }
- src/tools.ts:242-249 (schema)The tool schema definition in the tools array, specifying the name, description, and empty inputSchema (no parameters required). This is used for MCP tool listing.{ name: 'get_cookies', description: 'Obtém todos os cookies da página atual', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:115-118 (registration)The dispatch/registration in the main switch statement in index.ts where the 'get_cookies' tool call is handled by invoking the handler after initializing the browser page.case 'get_cookies': { const currentPage = await initBrowser(); return await handleGetCookies(currentPage); }
- src/index.ts:22-28 (registration)Import of the handleGetCookies handler function from browserTools.ts into the main index.ts for use in tool dispatching.handleGetCookies, handleEvaluateXPath, handleOpenBrowser, handleLogin, handleGetBrowserStatus, handleCloseBrowser, } from './browserTools.js';