Skip to main content
Glama

cookie_import

Import cookies in bulk from JSON, header strings, Netscape files, or curl arguments to restore browser session state.

Instructions

Bulk-import cookies. Three input modes — pick whichever is easiest:

1. cookies=[{...}]            inline array of dicts (DevTools / EditThisCookie shape)
2. file_path="..."            JSON file (array OR storage_state {"cookies":[...]})
3. raw_text="..."             paste any of these and we auto-parse:
                                • JSON array / object (same shapes as 1+2)
                                • Header string: "name=val; name2=val2" or
                                  "Cookie: name=val; name2=val2"
                                • Netscape cookies.txt (tab-separated)
                                • curl --cookie / -b argument string
   NOTE: header / netscape formats lack domain — pass default_domain=".example.com"
   (or call this AFTER navigate so the active tab's URL provides it).

Per-cookie fields (when JSON):
  {"name":"...", "value":"...", "domain":".example.com", "path":"/",
   "expires":1234567890, "secure":true, "httpOnly":false, "sameSite":"Lax"}

Args:
    cookies: inline array
    file_path: JSON file
    raw_text: any cookie text — format auto-detected
    default_domain: fallback domain for header / netscape cookies (or auto-uses
        current tab URL's host)
    clear_first: wipe all existing cookies before import (default False)

For full cookies + localStorage + sessionStorage restore, use storage_state_load.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cookiesNo
file_pathNo
raw_textNo
default_domainNo
clear_firstNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description discloses key behaviors: import modes, auto-parsing of raw_text, the effect of clear_first flag, and domain fallback logic. It does not contradict annotations (none provided). However, it could add details on error handling or side effects like overwriting existing cookies.

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 well-organized with a summary, bulleted modes, and args list. It is slightly verbose (e.g., per-cookie field example), but the structure aids readability. Could be trimmed slightly without losing clarity.

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 the tool's complexity (5 parameters, multiple input modes, auto-parsing, domain handling), the description covers all aspects thoroughly, includes examples, and references the output schema implicitly. It is complete for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining each parameter in detail, providing examples (inline array, file path, raw text formats), and noting default behavior for domain and clear_first. This goes well beyond the schema's type-only definitions.

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 tool's purpose as 'Bulk-import cookies' and enumerates three distinct input modes, making it specific and actionable. It also differentiates from a sibling tool (storage_state_load) by noting that this tool handles cookies only, not full storage.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use each input mode, including fallback domain handling for header/netscape formats, and advises calling after navigate or providing default_domain. It also points to the alternative sibling for full storage restore, giving clear when-to and when-not-to use.

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/RobithYusuf/mcp-stealth-chrome'

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