Skip to main content
Glama

browser_get_cookies

Retrieve all cookies from the current browser session to manage authentication states or track user data during web automation tasks.

Instructions

Get all cookies

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Direct registration of the 'browser_get_cookies' tool using server.tool(), including the inline handler function that uses CookieService to fetch and return all cookie names.
    server.tool('browser_get_cookies', 'Get all cookies', {}, async () => {
      const driver = stateManager.getDriver();
      const cookieService = new CookieService(driver);
      const cookies = await cookieService.getCookies();
      return {
        content: [{ type: 'text', text: `Cookies: ${cookies.join(', ')}` }],
      };
    });
  • Inline handler for 'browser_get_cookies' tool: retrieves Selenium driver, instantiates CookieService, gets all cookies, and formats response as text.
    server.tool('browser_get_cookies', 'Get all cookies', {}, async () => {
      const driver = stateManager.getDriver();
      const cookieService = new CookieService(driver);
      const cookies = await cookieService.getCookies();
      return {
        content: [{ type: 'text', text: `Cookies: ${cookies.join(', ')}` }],
      };
    });
  • Core helper method getCookies() in CookieService class, which uses Selenium WebDriver to fetch all cookies and returns array of cookie names.
    async getCookies(): Promise<string[]> {
      const cookies = await this.driver.manage().getCookies();
      return cookies.map(cookie => cookie.name);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Get all cookies' but doesn't disclose behavioral traits such as whether this requires specific permissions, if it returns active or stored cookies, potential rate limits, or error conditions. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 'Get all cookies' is extremely concise with zero wasted words, front-loading the core action. It efficiently communicates the tool's function in a minimal format, which is ideal for a simple, parameterless operation.

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

Completeness2/5

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

Given no annotations, no output schema, and a simple but potentially nuanced operation (cookie retrieval), the description is incomplete. It doesn't explain what 'all cookies' entails (e.g., scope, format), return values, or error handling. For a tool in a browser automation context with many siblings, more context is needed for effective use.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. A baseline of 4 is applied as it adequately handles the lack of parameters without introducing confusion.

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

Purpose3/5

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

The description 'Get all cookies' clearly states the action (get) and resource (cookies), making the purpose understandable. However, it lacks specificity about scope (e.g., current page vs. all domains) and doesn't differentiate from sibling tools like 'browser_get_cookie_by_name', which retrieves a specific cookie. This makes it vague compared to more precise alternatives.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention scenarios like retrieving all cookies for debugging versus getting a specific cookie, nor does it reference sibling tools like 'browser_get_cookie_by_name' for targeted queries. This leaves the agent without context for tool selection.

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/pshivapr/selenium-mcp'

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