Skip to main content
Glama

browser_set_cookie

Set cookies in the browser via CDP, including httpOnly ones, to support security tests like IDOR and session fixation.

Instructions

Set a cookie in the browser via CDP. Can set httpOnly cookies (unlike document.cookie in JS).

PREREQUISITE: browser_open and browser_go must have been called first (need a page loaded for domain).

USE CASES:

  • IDOR testing: Set another user's session cookie to test access controls

  • Session fixation: Pre-set a known session ID

  • Testing httpOnly bypass: Inject cookies that JavaScript can't normally set

Args: name: Cookie name (e.g. "session_id", "auth_token") value: Cookie value domain: Cookie domain (default: current page's domain). Must match or be a parent of the page domain. path: Cookie path (default: "/") http_only: Set the HttpOnly flag — makes cookie invisible to document.cookie (default false) secure: Set the Secure flag — cookie only sent over HTTPS (default false) session_name: Browser session to use (default: "default")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
pathNo/
valueYes
domainNo
secureNo
tab_idNo
http_onlyNo
session_nameNodefault

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full transparency burden. It discloses key behaviors: httpOnly support, domain matching constraints, and default values for path and flags. However, it omits mention of the tab_id parameter and any side effects like overwriting existing cookies, which keeps it from a perfect score.

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

Conciseness4/5

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

The description is moderately long but well-structured with clear sections (purpose, prerequisite, use cases, args). Each sentence adds value, and the front-loaded purpose allows quick understanding. Slight verbosity in the use-case list is acceptable given its practical utility for security testing.

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

Completeness5/5

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

For a tool with 8 parameters and no annotations, the description is remarkably complete. It provides prerequisites, use cases, parameter constraints, and defaults. The output schema exists, so return-value details are not required. The only minor gap is tab_id, but overall the description equips an agent to select and invoke the tool correctly in most scenarios.

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?

Despite 0% schema description coverage, the description explains every parameter except tab_id. It adds meaningful context: name examples, domain must match parent domain, path default, secure and http_only flag effects, and session_name default. The omission of tab_id is a minor gap given it appears in the schema but is undocumented in the description.

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?

The description clearly states 'Set a cookie in the browser via CDP' with a specific verb and resource. It distinguishes itself from document.cookie in JS by highlighting the ability to set httpOnly cookies, which sets it apart from sibling browser manipulation tools.

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 lists the prerequisite (browser_open and browser_go) and provides concrete use cases (IDOR testing, session fixation, httpOnly bypass). It also implicitly contrasts with JavaScript document.cookie, giving an alternative approach for the same task. This goes beyond mere context to actionable guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BobongKu/nodriver-proxy-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server