Skip to main content
Glama

set_cookies

Destructive

Set cookies directly in the real browser profile to restore sessions, manage authentication, or prepare test states. Supports HttpOnly and cross-path cookies via CDP.

Instructions

Write cookies into the real browser profile. Takes one cookie object or a list (JSON text is accepted): name is required, plus optional value/url/domain/path/expires (Unix seconds)/httpOnly/secure/sameSite. Uses CDP Network.setCookie so HttpOnly and cross-path cookies work; falls back to document.cookie only if CDP is unavailable, and then says which cookies could not carry HttpOnly. Cookies with neither url nor domain are scoped to the current page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tab_idNo
cookiesYes
timeoutNo
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=false and destructiveHint=true, so the description's 'write' is consistent. It adds value by disclosing the CDP-first approach with fallback to document.cookie, noting that HttpOnly cannot be carried in fallback, and explaining scoping of cookies without url/domain. This is behavioral detail beyond the annotations.

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?

The description is front-loaded with the purpose, then efficiently packs format details, fallback behavior, and scoping rules. Every sentence contributes meaningful information without redundancy, making it dense but readable.

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?

Given the tool's complexity (4 params, output schema exists) the description covers the main functionality well: accepted formats, required field, fallback, and scoping. It does not mention overwrite behavior or error cases, but the output schema handles return values, and the provided details are sufficient for a typical agent to call it correctly.

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?

With 0% schema description coverage, the description must compensate. It thoroughly explains the 'cookies' parameter (formats, required name, optional fields, expiry units), which is the core. However, it does not explain tab_id, timeout, or session_id, which are left to inference from their names and defaults. This partial compensation is adequate for the primary parameter but incomplete for the others.

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 the verb ('Write') and resource ('cookies') with the target context ('real browser profile'), and lists the accepted formats and required field. This unambiguously distinguishes it from sibling cookie tools like get_cookies and delete_cookies, which are obvious from their names.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool (when you need to write cookies) but does not explicitly mention alternatives or exclusion criteria. It does not say 'use this instead of get_cookies for reading' or provide any conditional guidance, so an agent must infer usage from the verb alone.

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