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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states what the tool does ('gets all cookies') but lacks behavioral details such as whether it requires specific permissions, the format of returned data, error conditions, or if it's a read-only operation. This is a significant gap for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Portuguese that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It explains what the tool does but lacks details on behavioral traits, return values, or usage context. Without annotations or output schema, more completeness would be beneficial, but it meets a basic threshold.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description does not add parameter information, which is appropriate. Baseline is 4 for zero parameters, as there is nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Obtém todos os cookies da página atual' clearly states the verb ('obtém' - gets) and resource ('cookies da página atual'), making the purpose specific and understandable. It distinguishes from siblings like get_local_storage or get_page_info by focusing on cookies. However, it lacks explicit sibling differentiation (e.g., 'unlike get_local_storage, which retrieves storage data').

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., requires a page to be loaded), exclusions, or comparisons to siblings like get_local_storage or get_page_info. Usage is implied by the action but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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