Skip to main content
Glama

Import cookies from a JSON file

browser_import_cookies_from_file
Destructive

Reads an array of cookie objects from a JSON file and sets them in the existing shared BiDi session, avoiding manual entry and external-session conflicts.

Instructions

Read a JSON file containing an array of cookie objects and set them all inside the existing shared BiDi session. Each object may have {name, value, domain, path, expirySeconds, secure, httpOnly, sameSite}. This exists because an external script cannot open its own BiDi session while this server holds the only one, and hand-typing hundreds of cookies through browser_import_cookies is impractical.

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path to the JSON file

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

The annotations already declare readOnlyHint=false and destructiveHint=true, so the agent knows this is a mutating, destructive operation. The description adds useful context that cookies are set inside the existing shared BiDi session and that an external script cannot own a session here. However, it does not clarify overwrite semantics for existing cookies, error handling, or whether any existing session state is replaced.

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?

Three sentences, front-loaded with the action and mechanism, followed by file format and then rationale. Every sentence earns its place with no redundant filler.

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 one-parameter mutating tool with annotations and no output schema, the description covers purpose, file format, session mechanism, and differentiation from a sibling. The only notable omissions are overwrite semantics and failure behavior, which are minor but relevant for a destructive operation.

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 for the single path parameter is 100%, so the schema already explains the file path. The description adds meaningful value by specifying the expected file contents: an array of cookie objects with fields such as name, value, domain, path, expirySeconds, secure, httpOnly, and sameSite.

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?

States a specific verb and resource ('Read a JSON file... and set them all inside the existing shared BiDi session'), and explicitly contrasts this bulk mechanism with browser_import_cookies. An agent can distinguish it from sibling cookie tools like browser_set_cookie and browser_import_cookies without opening any schema.

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

Usage Guidelines4/5

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

Explains why the tool exists: external scripts cannot open their own BiDi session while the server holds the only one, and hand-typing hundreds of cookies through browser_import_cookies is impractical. This implies the right context (bulk import from file), but it does not explicitly state when to prefer browser_import_cookies or browser_set_cookie instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools