Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

get_local_storage

Retrieve specific or all localStorage values from a browser tab. Specify a key to get a single entry or omit to fetch all stored data.

Instructions

Read localStorage entries for the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoSpecific key to read (returns all if omitted)
tabIdNoTarget tab ID (defaults to active tab)
apiKeyNoAPI key for authentication

Implementation Reference

  • The handler function for the 'get_local_storage' tool. Sends a 'get_local_storage' command via the WebSocket bridge to the Chrome extension, which reads localStorage entries for the current page. Supports an optional 'key' parameter (returns all if omitted), optional 'tabId', and optional 'apiKey'. Returns the result as a JSON string.
    async ({ key, tabId, apiKey }) => {
      const result = await bridge.sendCommand({ command: 'get_local_storage', params: { key }, tabId, apiKey });
      if (!result.success) return { content: [{ type: 'text' as const, text: `Error: ${result.error?.message}` }], isError: true };
      return { content: [{ type: 'text' as const, text: JSON.stringify(result.data, null, 2) }] };
    }
  • Zod schema definition for the 'get_local_storage' tool parameters: optional 'key' (string), optional 'tabId' (number), and optional 'apiKey' (string).
    {
      key: z.string().optional().describe('Specific key to read (returns all if omitted)'),
      tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
      apiKey: z.string().optional().describe('API key for authentication'),
    },
  • Registration of the 'get_local_storage' tool via server.tool(), binding the tool name, description, schema, and handler together.
    server.tool(
      'get_local_storage',
      'Read localStorage entries for the current page',
      {
        key: z.string().optional().describe('Specific key to read (returns all if omitted)'),
        tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
        apiKey: z.string().optional().describe('API key for authentication'),
      },
      async ({ key, tabId, apiKey }) => {
        const result = await bridge.sendCommand({ command: 'get_local_storage', params: { key }, tabId, apiKey });
        if (!result.success) return { content: [{ type: 'text' as const, text: `Error: ${result.error?.message}` }], isError: true };
        return { content: [{ type: 'text' as const, text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • The registerAllTools function that calls registerDevtoolsStorageTools (line 42) to register all devtools storage tools including get_local_storage.
    export function registerAllTools(server: McpServer, bridge: WebSocketBridge) {
      registerNavigationTools(server, bridge);
      registerTabManagementTools(server, bridge);
      registerKeyboardTools(server, bridge);
      registerScreenshotTools(server, bridge);
      registerClickTools(server, bridge);
      registerInputTools(server, bridge);
      registerDragDropTools(server, bridge);
      registerHoverTools(server, bridge);
    
      registerDevtoolsSourcesTools(server, bridge);
      registerDevtoolsModifyTools(server, bridge);
      registerDevtoolsNetworkTools(server, bridge);
      registerDevtoolsStorageTools(server, bridge);
      registerDevtoolsConsoleTools(server, bridge);
    
      registerAccessibilityTools(server, bridge);
      registerEmulationTools(server, bridge);
      registerElementTools(server, bridge);
      registerAuditTools(server, bridge);
      registerInteractionTools(server, bridge);
      registerMonitoringTools(server, bridge);
      registerQaTools(server, bridge);
      registerGestureTools(server, bridge);
      registerMacroTools(server, bridge);
      registerVisualRegressionTools(server, bridge);
    }
Behavior2/5

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

No annotations are present, so the description bears full responsibility for behavioral disclosure. It only states the basic read operation without discussing side effects, permissions, or limitations (e.g., storage is per-origin, authentication needed via apiKey).

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

Conciseness4/5

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

The description is a single concise sentence that communicates the core purpose immediately. However, it is perhaps too brief; adding a few more details would improve completeness without sacrificing conciseness.

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 lack of annotations and output schema, the description is insufficiently complete. It does not explain how tabId or apiKey affect behavior, nor any constraints or return format, leaving gaps for the agent.

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 parameters. The description adds no additional meaning beyond what is in the schema, resulting in a neutral baseline score.

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 'Read' and resource 'localStorage entries', and specifies the scope ('for the current page'). However, it could be more precise by indicating that the operation can target a specific tab via the tabId parameter, which adds minor ambiguity.

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 guidelines are provided about when to use this tool versus siblings like get_session_storage or set_local_storage. The description does not mention any context for appropriate usage, requiring the agent to infer from the name alone.

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/BrowserGenie/mcp'

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