Skip to main content
Glama

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

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • 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), }, ], }; }
  • 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';

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EmmanuelBarbosaMonteiro/mcp-server-browser'

If you have feedback or need assistance with the MCP directory API, please join our Discord server