Skip to main content
Glama
Lokii0911
by Lokii0911

list_cookies

Retrieve browser cookies for the current domain to inspect session data, authentication tokens, and user preferences during Selenium automation.

Instructions

Return browser cookies for the current domain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool registration for 'list_cookies' using @mcp.tool() decorator on FastMCP instance. Delegates to browser.cookies via _run helper.
    @mcp.tool()
    def list_cookies() -> dict[str, list[dict[str, Any]]]:
        """Return browser cookies for the current domain."""
        return _run("list_cookies", browser.cookies)
  • Actual handler in BrowserManager. Calls Selenium's get_cookies() on the current WebDriver under thread lock and returns them wrapped in a dict.
    def cookies(self) -> dict[str, list[dict[str, Any]]]:
        with self._lock:
            return {"cookies": self._require_driver().get_cookies()}
  • Generic execution helper that invokes the handler function, converts result using _as_dict, and wraps exceptions into BrowserError.
    def _run(action: str, func: Any, *args: Any, **kwargs: Any) -> Any:
        try:
            return _as_dict(func(*args, **kwargs))
        except BrowserError:
            logger.exception("Browser action failed: %s", action)
            raise
        except Exception as exc:
            logger.exception("Unexpected Selenium MCP error during %s", action)
            raise BrowserError(f"{action} failed: {exc}") from exc
  • Utility to convert pydantic models to dicts; cookies are plain dicts so this is a pass-through.
    def _as_dict(value: Any) -> Any:
        if hasattr(value, "model_dump"):
            return value.model_dump()
        return value
Behavior4/5

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

With no annotations, the description correctly conveys a read-only operation without side effects. It specifies the domain constraint, but lacks details on permissions or data format.

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?

Single sentence with no waste, front-loaded with action. Perfectly concise for the tool's simplicity.

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

Completeness5/5

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

Given no parameters and an output schema, the description adequately explains the tool's behavior. The domain scope is clear for browser automation.

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?

No parameters exist, so baseline is 4. The description adds the domain context, clarifying scope beyond the empty schema.

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 action (return cookies) and the scope (current domain), distinguishing it from sibling tools like add_cookie and delete_cookies.

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 on when to use this tool versus alternatives like add_cookie or delete_cookies. The description does not provide context for choosing this tool.

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/Lokii0911/SeleniumMCP'

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