Skip to main content
Glama
WhiteNightShadow

camoufox-reverse-mcp

get_storage

Retrieve all key-value pairs from localStorage or sessionStorage. Choose between local or session storage to extract stored data.

Instructions

Get the contents of localStorage or sessionStorage.

Args: storage_type: "local" for localStorage, "session" for sessionStorage.

Returns: dict with all key-value pairs in the storage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
storage_typeNolocal

Implementation Reference

  • The get_storage tool handler: retrieves localStorage or sessionStorage contents via browser page.evaluate(). Decorated with @mcp.tool().
    @mcp.tool()
    async def get_storage(storage_type: str = "local") -> dict:
        """Get the contents of localStorage or sessionStorage.
    
        Args:
            storage_type: "local" for localStorage, "session" for sessionStorage.
    
        Returns:
            dict with all key-value pairs in the storage.
        """
        try:
            page = await browser_manager.get_active_page()
            if storage_type == "local":
                data = await page.evaluate("""() => {
                    const obj = {};
                    for (let i = 0; i < localStorage.length; i++) {
                        const key = localStorage.key(i);
                        obj[key] = localStorage.getItem(key);
                    }
                    return obj;
                }""")
            elif storage_type == "session":
                data = await page.evaluate("""() => {
                    const obj = {};
                    for (let i = 0; i < sessionStorage.length; i++) {
                        const key = sessionStorage.key(i);
                        obj[key] = sessionStorage.getItem(key);
                    }
                    return obj;
                }""")
            else:
                return {"error": f"Invalid storage_type: {storage_type}. Use 'local' or 'session'."}
            return {"storage_type": storage_type, "data": data, "count": len(data)}
        except Exception as e:
            return {"error": str(e)}
  • Input schema: accepts optional 'storage_type' param (str, default 'local'), validated at runtime.
    async def get_storage(storage_type: str = "local") -> dict:
  • Registration via import: 'from .tools import storage' which triggers @mcp.tool() decorators, making get_storage available as an MCP tool.
    from .tools import storage          # noqa: E402, F401  — cookies() + get_storage + export/import state
  • Tool registration via @mcp.tool() decorator on line 76, registers get_storage with FastMCP server.
    @mcp.tool()
Behavior3/5

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

Without annotations, the description carries full burden. It conveys a read operation ('Get') and specifies the return format as a dict of key-value pairs, but omits details like error handling, permissions, or idempotency.

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: three sentences with no waste. The purpose is front-loaded, and the parameter and return are clearly separated.

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

Completeness4/5

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

For a simple getter with 0 required parameters and no output schema, the description covers the core behavior and return format. Minor gaps (e.g., error states) but acceptable given low complexity.

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?

Schema coverage is 0%, but the description explains the single parameter 'storage_type' with its allowed values ('local' for localStorage, 'session' for sessionStorage), adding significant meaning beyond the schema's bare type declaration.

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

Purpose5/5

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

The description clearly states the verb 'Get' and the resource 'contents of localStorage or sessionStorage', distinguishing it from sibling tools that handle other aspects like page info or console logs.

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 explicit guidance on when to use this tool versus alternatives (e.g., get_page_info for DOM data). The context of siblings is not leveraged to set exclusions or prerequisites.

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/WhiteNightShadow/camoufox-reverse-mcp'

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