Skip to main content
Glama
andresolbach

nodriver-mcp-server

Set cookie

set_cookie
Idempotent

Set a browser cookie to inject a known session token, consent flag, or A/B bucket, bypassing the login flow. Creates a session cookie that lasts for the browser session.

Instructions

Set a single browser cookie.

Useful for injecting a known session token, consent flag or A/B bucket without walking through a login flow.

This creates a session cookie: no expiry, gone when the browser closes. To restore a full cookie set including expiry and SameSite, use load_session. Cookies are browser-wide, not per tab.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCookie name.
pathNoURL path the cookie is scoped to. "/" covers the whole site./
valueYesCookie value.
domainYesDomain the cookie belongs to, e.g. "example.com". A leading dot (".example.com") makes it apply to subdomains as well.
secureNoSend the cookie over HTTPS only. Browsers require this for any cookie with SameSite=None.
browserNoWhich browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name.default

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.0
    • addedInput schema / properties / browser
      Added value: +{
      +  "default": "default",
      +  "description": "Which browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name.",
      +  "type": "string"
      +}
  2. First observedv1.7.2

TDQS

A4.4/5.0
Behavior4/5

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

With annotations already declaring idempotentHint=true and destructiveHint=false, the description adds two non-obvious behaviors beyond that: the cookie is session-only ('no expiry, gone when the browser closes') and it is browser-wide rather than per-tab. These guard against the common assumption that an injected cookie persists across restarts. It doesn't cover failure modes like a domain-mismatched cookie being rejected, but the key traits are disclosed.

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?

Five short sentences, each earning its place: purpose, use case, session-lifetime behavior, alternative routing, and scope. The core action is front-loaded and there is no filler or repetition of what the schema already states.

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 six-parameter tool with full schema coverage, an output schema, and informative annotations, the description covers what, when, why, and the two key behavioral constraints. The only noticeable gap is the absence of failure-mode guidance (e.g., cookies being refused for a domain the browser isn't currently on), which keeps it just short of fully complete.

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%, and the schema itself is rich — it documents subdomain behavior via a leading dot on domain, the SameSite=None caveat on secure, and parallel-agent isolation on browser. The description adds no per-parameter detail, but the baseline of 3 applies because the schema already carries that weight.

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?

Opens with a specific verb+resource — 'Set a single browser cookie' — where 'single' immediately distinguishes it from sibling cookie tools like get_cookies, clear_cookies, and load_session. The named use cases (session token, consent flag, A/B bucket) make the tool's role unmistakable.

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?

Explicitly routes to an alternative: 'To restore a full cookie set including expiry and SameSite, use load_session.' It also gives a concrete when-to-use scenario ('without walking through a login flow') and a scope warning (browser-wide, not per tab), so an agent can select between set_cookie and load_session without guessing.

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