Skip to main content
Glama

browser_delete_cookie

Remove a specific cookie from the browser to manage session data, clear authentication tokens, or comply with privacy requirements during automated web testing.

Instructions

Delete a cookie from the browser

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the cookie to delete

Implementation Reference

  • The inline handler function for the 'browser_delete_cookie' tool. It retrieves the WebDriver instance, instantiates CookieService, calls deleteCookie on it with the provided name, and returns a success message.
    async ({ name }) => {
      const driver = stateManager.getDriver();
      const cookieService = new CookieService(driver);
      await cookieService.deleteCookie(name);
      return {
        content: [{ type: 'text', text: `Deleted cookie: ${name}` }],
      };
    }
  • Zod input schema defining the 'name' parameter for the 'browser_delete_cookie' tool.
    {
      name: z.string().describe('Name of the cookie to delete'),
    },
  • Direct registration of the 'browser_delete_cookie' tool using server.tool(), including schema and inline handler.
    server.tool(
      'browser_delete_cookie',
      'Delete a cookie from the browser',
      {
        name: z.string().describe('Name of the cookie to delete'),
      },
      async ({ name }) => {
        const driver = stateManager.getDriver();
        const cookieService = new CookieService(driver);
        await cookieService.deleteCookie(name);
        return {
          content: [{ type: 'text', text: `Deleted cookie: ${name}` }],
        };
      }
    );
  • CookieService helper method that executes the Selenium WebDriver command to delete a cookie by name.
    async deleteCookie(name: string): Promise<void> {
      await this.driver.manage().deleteCookie(name);
    }
  • Higher-level registration call for all cookie tools, including 'browser_delete_cookie', within registerAllTools.
    registerCookieTools(server, stateManager);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Delete' implies a destructive mutation, the description doesn't specify whether this requires specific permissions, if the deletion is permanent, what happens on failure, or if there are side effects (e.g., affecting browser state). For a mutation 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 is a single, direct sentence that states the tool's purpose without any fluff or redundancy. It's appropriately sized for a simple operation and front-loaded with the essential action, making it highly efficient and easy to parse.

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?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks critical context such as error handling, return values, side effects, or prerequisites (e.g., browser session state). Given the tool's potential impact and the absence of structured behavioral data, the description should provide more operational guidance to be considered adequate.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'name' clearly documented in the schema as 'Name of the cookie to delete'. The description doesn't add any additional semantic context beyond what the schema provides (e.g., format examples, case sensitivity, or domain scope). With high schema coverage, the baseline score of 3 is appropriate.

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 clearly states the action ('Delete') and the resource ('a cookie from the browser'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'browser_delete_cookies' (plural) or 'browser_get_cookie_by_name', which would require a more specific scope statement to earn a 5.

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 doesn't mention sibling tools like 'browser_delete_cookies' (for bulk deletion) or 'browser_get_cookie_by_name' (for retrieval), nor does it specify prerequisites (e.g., needing an active browser session). This lack of contextual guidance leaves the agent to infer usage scenarios.

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