Skip to main content
Glama

pilot_storage

Retrieve browser storage data as JSON with sensitive values redacted, or set localStorage values for automated web interactions.

Instructions

Get localStorage + sessionStorage as JSON (sensitive values redacted). Optionally set a localStorage key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
set_keyNoKey to set in localStorage
set_valueNoValue to set

Implementation Reference

  • Implementation of the 'pilot_storage' tool which reads/sets browser storage.
    server.tool(
      'pilot_storage',
      'Get localStorage + sessionStorage as JSON (sensitive values redacted). Optionally set a localStorage key.',
      {
        set_key: z.string().optional().describe('Key to set in localStorage'),
        set_value: z.string().optional().describe('Value to set'),
      },
      async ({ set_key, set_value }) => {
        await bm.ensureBrowser();
        try {
          const page = bm.getPage();
          if (set_key) {
            await page.evaluate(([k, v]) => localStorage.setItem(k, v), [set_key, set_value || '']);
            return { content: [{ type: 'text' as const, text: `Set localStorage["${set_key}"]` }] };
          }
          const storage = await page.evaluate(() => ({
            localStorage: { ...localStorage },
            sessionStorage: { ...sessionStorage },
          }));
          // Redact sensitive values
          const SENSITIVE_KEY = /(^|[_.-])(token|secret|key|password|credential|auth|jwt|session|csrf)($|[_.-])|api.?key/i;
          const SENSITIVE_VALUE = /^(eyJ|sk-|sk_live_|pk_live_|ghp_|gho_|github_pat_|xox[bpsa]-|AKIA|AIza|SG\.|Bearer\s|sbp_)/;
          const redacted = JSON.parse(JSON.stringify(storage));
          for (const storeType of ['localStorage', 'sessionStorage'] as const) {
            const store = redacted[storeType];
            if (!store) continue;
            for (const [key, value] of Object.entries(store)) {
              if (typeof value !== 'string') continue;
              if (SENSITIVE_KEY.test(key) || SENSITIVE_VALUE.test(value)) {
                store[key] = `[REDACTED — ${value.length} chars]`;
              }
            }
          }
          return { content: [{ type: 'text' as const, text: JSON.stringify(redacted, null, 2) }] };
        } catch (err) {
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
Behavior3/5

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

Discloses the redaction of sensitive values, which is crucial behavioral context. Mentions JSON format. However, with no annotations provided, it fails to explicitly confirm the mutation semantics when setting values, describe the JSON structure (e.g., separated by storage type), or explain error conditions (e.g., setting without value).

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?

Extremely concise two-sentence structure. Front-loaded with the primary read operation, followed by the optional write capability. No redundant words or repetition of schema details.

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?

Adequate for a simple tool but lacking output schema description. Should specify the returned JSON structure (whether it separates localStorage/sessionStorage, includes metadata, etc.) given no output schema exists. Also should clarify the conditional mutation behavior.

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 has 100% coverage with clear descriptions for both set_key and set_value. The description adds the word 'Optionally' which reinforces optionality, but doesn't clarify the relationship between the two parameters (that they must be used together) or validation constraints beyond what the schema provides.

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 dual functionality: retrieving localStorage and sessionStorage as JSON, with optional setting of localStorage keys. It specifies the output format (JSON) and security handling (redaction). However, it doesn't explicitly distinguish this from pilot_cookies or clarify it's browser storage vs other storage types.

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 provided on when to use this versus pilot_cookies or other state-inspection tools. No mention of when setting is appropriate versus other modification methods, or that set_key and set_value should be used together.

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/TacosyHorchata/Pilot'

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