Skip to main content
Glama

browser_set_cookie

Set or update a browser cookie with name, value, domain, path, expiry, SameSite, and secure flags to manage authenticated sessions and site state.

Instructions

Set or update a browser cookie

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "value": "<value>"
    },
    "name": "browser_set_cookie"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesCookie name
pathNoCookie path (defaults to /)
valueYesCookie value
domainNoCookie domain, e.g. .example.com
secureNoSecure cookie (HTTPS only)
expiresNoExpiry as a Unix timestamp in seconds
httpOnlyNoHttpOnly flag (currently not supported by the document.cookie setter)
sameSiteNoSameSite policy

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden for a mutation tool and it does not meet it. It never says whether an existing cookie with the same name/domain/path is overwritten, whether the change applies to the live page or the next navigation, or what the result looks like. Notably, the schema flags that httpOnly is unsupported, but the description does not surface that limitation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The single sentence is front-loaded and free of filler, but it is under-specified rather than concise for an 8-parameter mutation tool. There is room to add one clarifying sentence about scope and overwrite behavior without bloat.

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

Completeness2/5

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

With 8 parameters, no annotations, and no output schema, the description should cover at minimum scope and overwrite semantics. It leaves the agent unable to predict whether the set takes effect immediately in the current document context or what failure modes exist.

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 description coverage is 100%, with all 8 parameters individually documented including the enum for sameSite and the httpOnly caveat. The description adds no parameter-level meaning beyond that, so the baseline 3 applies.

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 gives a specific verb pair (set/update) and a specific resource (browser cookie), which cleanly separates it from browser_get_cookies and browser_delete_cookie among the siblings. It stops short of naming those siblings explicitly, so differentiation is implicit rather than stated.

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?

There is no guidance on when to use this rather than browser_get_cookies, browser_delete_cookie, or execute_script/document.cookie. Nothing states prerequisites such as the cookie being scoped to the current page's domain or whether a reload is needed for the page to observe the change.

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