Skip to main content
Glama

reset_browser_data

Clear browser cookies, cache, localStorage, and sessionStorage to reset browser state for testing consent management platforms.

Instructions

Reset browser data including cookies, cache, localStorage, and sessionStorage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearCookiesNoClear browser cookies (default: true)
clearCacheNoClear browser cache (default: true)
clearLocalStorageNoClear localStorage (default: true)
clearSessionStorageNoClear sessionStorage (default: true)

Implementation Reference

  • The core handler function that implements the reset_browser_data tool logic, clearing cookies, cache, localStorage, and sessionStorage using Puppeteer's CDP session and page.evaluate.
    export async function resetBrowserData(
      page: Page,
      options: BrowserResetOptions = {
        clearCookies: true,
        clearCache: true,
        clearLocalStorage: true,
        clearSessionStorage: true,
      },
    ): Promise<void> {
      const client = await page.target().createCDPSession();
    
      // Clear cookies
      if (options.clearCookies) {
        await client.send("Network.clearBrowserCookies");
      }
    
      // Clear browser cache
      if (options.clearCache) {
        await client.send("Network.clearBrowserCache");
      }
    
      // Clear localStorage and sessionStorage
      if (options.clearLocalStorage || options.clearSessionStorage) {
        await page.evaluate((opts) => {
          if (opts.clearLocalStorage && typeof localStorage !== "undefined") {
            localStorage.clear();
          }
          if (opts.clearSessionStorage && typeof sessionStorage !== "undefined") {
            sessionStorage.clear();
          }
        }, options);
      }
    }
  • Type definition for the options parameter used in resetBrowserData, matching the tool's inputSchema.
    export type BrowserResetOptions = {
      clearCookies?: boolean;
      clearCache?: boolean;
      clearLocalStorage?: boolean;
      clearSessionStorage?: boolean;
    };
  • src/index.ts:143-169 (registration)
    Registration of the reset_browser_data tool in the TOOLS array, including name, description, and inputSchema.
    {
      name: "reset_browser_data",
      description:
        "Reset browser data including cookies, cache, localStorage, and sessionStorage",
      inputSchema: {
        type: "object",
        properties: {
          clearCookies: {
            type: "boolean",
            description: "Clear browser cookies (default: true)",
          },
          clearCache: {
            type: "boolean",
            description: "Clear browser cache (default: true)",
          },
          clearLocalStorage: {
            type: "boolean",
            description: "Clear localStorage (default: true)",
          },
          clearSessionStorage: {
            type: "boolean",
            description: "Clear sessionStorage (default: true)",
          },
        },
        required: [],
      },
    },
  • Wrapper handler in the main tool dispatch switch (handleToolCall) that processes arguments and calls the resetBrowserData function.
    case "reset_browser_data":
      try {
        const options = {
          clearCookies: args.clearCookies ?? true,
          clearCache: args.clearCache ?? true,
          clearLocalStorage: args.clearLocalStorage ?? true,
          clearSessionStorage: args.clearSessionStorage ?? true,
        };
    
        await resetBrowserData(page, options);
    
        const clearedItems = [];
        if (options.clearCookies) clearedItems.push("cookies");
        if (options.clearCache) clearedItems.push("cache");
        if (options.clearLocalStorage) clearedItems.push("localStorage");
        if (options.clearSessionStorage) clearedItems.push("sessionStorage");
    
        return {
          content: [
            {
              type: "text",
              text: `Successfully cleared: ${clearedItems.join(", ")}`,
            },
          ],
          isError: false,
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Failed to reset browser data: ${(error as Error).message}`,
            },
          ],
          isError: true,
        };
      }
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 'reset' implying a destructive mutation, but doesn't disclose behavioral traits such as whether this requires specific permissions, if changes are irreversible, potential side effects (e.g., logged-out sessions), or rate limits. For a mutation tool with zero annotation coverage, this is a significant gap.

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 with zero waste. It's front-loaded with the core action and includes specific examples without unnecessary elaboration. Every word earns its place, making it highly concise and well-structured.

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 the tool's complexity (destructive mutation with 4 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or provide enough context for safe and effective use. A mutation tool should include more behavioral and usage details to be complete.

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%, so the schema already documents all four parameters with clear descriptions and defaults. The description lists the data types (cookies, cache, localStorage, sessionStorage) that map to parameters, but adds no additional meaning beyond what the schema provides. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb 'reset' and the resource 'browser data', with specific examples (cookies, cache, localStorage, sessionStorage). It distinguishes from siblings like 'reload' or 'navigate' by focusing on data clearing rather than navigation or interaction. However, it doesn't explicitly differentiate from all siblings, missing a perfect score.

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 prerequisites, consequences, or typical use cases (e.g., for testing, privacy, or troubleshooting). With siblings like 'reload' or 'click', there's no explicit comparison or exclusion criteria.

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/noisysocks/autoconsent-mcp'

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