Skip to main content
Glama

browser_set_cookies

Sets one or more browser cookies for a domain or URL so agents can manage session state and authentication across logged-in workflows.

Instructions

Set one or more cookies for a domain.

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_cookies"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoURL for the cookie (alternative to domain)
nameYesCookie name
pathNoCookie path (default: /)
valueYesCookie value
domainNoCookie domain (e.g. ".example.com")
secureNoSecure flag (default: true)
cookiesNoArray of cookie objects to set multiple at once
httpOnlyNoHttpOnly flag (default: false)
sameSiteNoSameSite attribute (default: lax)
partitionNoRun this call in a partition from browser_partition (an id like "p1"). Leave it out for the default partition. An unknown or closed id is an error; the call is never sent to the default partition instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.33.0
    • addedInput schema / properties / partition
      Added value: +{
      +  "description": "Run this call in a partition from browser_partition (an id like \"p1\"). Leave it out for the default partition. An unknown or closed id is an error; the call is never sent to the default partition instead.",
      +  "type": "string"
      +}
  2. First observedv1.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 supplied, so the description carries the full behavioral burden, yet it says nothing about whether existing cookies are overwritten, whether a navigation must happen first for the domain to match, how the partition parameter behaves, or what errors look like. The only behavioral hints (defaults for secure, sameSite, path, httpOnly) live in the schema rather than the description.

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?

A single front-loaded sentence with no filler, which is good structure. However, it is undersized for a 10-parameter tool with no annotations, so brevity here trades away needed detail rather than earning its place.

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?

For a 10-parameter mutation tool with no annotations and no output schema, the definition leaves out overwrite semantics, partition error behavior, and how the bulk cookies array relates to the required name/value pair. An agent could call it but would likely guess wrong on bulk and partition usage.

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%, so parameter meaning is already fully documented, making 3 the baseline. The description does add that bulk setting is supported ("one or more") and ties the operation to a domain, but adds no detail on the cookies array vs. individual name/value interaction or url-vs-domain precedence.

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?

States a specific verb and resource ("Set ... cookies") plus scope ("for a domain") and cardinality ("one or more"), which separates it from browser_get_cookies in the sibling list. It stops short of naming any sibling or explaining how it differs from browser_set_local_storage.

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 when-to-use guidance, no prerequisites, and no mention of the read counterpart browser_get_cookies or of partition selection. The agent must infer all invocation context from the schema alone.

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