Skip to main content
Glama

Set a cookie

browser_set_cookie

Create or replace a single browser cookie with scoped domain, path, expiry, and security flags, then verify the stored value with browser_get_cookies.

Instructions

Create or replace one cookie (BiDi storage.setCookie). domain and path scope it; omit domain for a host-only cookie. Use browser_get_cookies afterwards to confirm the value and expiry the browser actually stored.

Input Schema

NameRequiredDescriptionDefault
nameYesCookie name
pathNoCookie path (default "/")
valueYesCookie value
domainYesCookie domain, e.g. "127.0.0.1"
secureNoMark the cookie Secure
httpOnlyNoMark the cookie HttpOnly
sameSiteNoSameSite policy
expirySecondsNoExpiry as a Unix timestamp in seconds

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only flag readOnlyHint=false, so the description earns credit for disclosing upsert semantics ('create or replace'), scoping rules, and host-only behavior. It does not say what happens to a pre-existing cookie's other attributes (secure/httpOnly/sameSite) when replaced, which is the remaining behavioral gap.

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?

Two tight sentences: the action and upsert semantics come first, then scoping guidance, then a verification pointer. Nothing redundant with the schema is restated.

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 an 8-parameter mutation with no output schema, the description covers upsert behavior, scoping, and how to confirm the result. It would be complete if it resolved the required-vs-optional domain question and noted that non-specified attributes are defaulted rather than preserved on replace.

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 coverage is 100%, so the baseline is 3. The description adds real meaning about domain/path scoping, but it also says 'omit domain for a host-only cookie' while the schema marks domain as required — a conflict that leaves the agent unsure whether the call will succeed without it.

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+resource ('Create or replace one cookie') and names the underlying primitive (BiDi storage.setCookie), which cleanly separates it from browser_get_cookies, browser_delete_cookies, and the various import_cookies siblings.

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?

Gives concrete usage context: domain/path scope the cookie, omit domain for host-only, and verify afterwards with browser_get_cookies. It does not explicitly contrast with browser_delete_cookies or the import_cookies tools, but the intended use case is unambiguous.

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