Skip to main content
Glama

add_cookie

Set a browser cookie by name and value to skip login screens or enable test modes. Navigate to the target domain first, then refresh for the page to see it.

Instructions

Set a cookie in the browser, e.g. a session or feature-flag cookie to skip a login screen or switch on a test mode. Browsers only accept cookies for the site that is currently open, so navigate to a page on that domain first. The page does not see the cookie until its next request, so refresh (history) or navigate afterwards. Setting an existing name replaces that cookie.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCookie name, e.g. 'session_id'.
pathNoURL path the cookie applies to (default '/').
valueYesCookie value.
domainNoDomain the cookie applies to, e.g. '.example.com' to include subdomains. Defaults to the current page's host.
expiryNoExpiry as a Unix timestamp in seconds. Omit for a session cookie that ends when the browser closes.
secureNoOnly send the cookie over HTTPS.
httpOnlyNoHide the cookie from page JavaScript (document.cookie).
sameSiteNoSameSite policy: Strict, Lax, or None (None also requires secure: true). Omit for the browser default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.3.0
    • addedInput schema / properties / domain / description
      Added value: +"Domain the cookie applies to, e.g. '.example.com' to include subdomains. Defaults to the current page's host."
    • addedInput schema / properties / expiry / description
      Added value: +"Expiry as a Unix timestamp in seconds. Omit for a session cookie that ends when the browser closes."
    • addedInput schema / properties / httpOnly / description
      Added value: +"Hide the cookie from page JavaScript (document.cookie)."
    • addedInput schema / properties / name / description
      Added value: +"Cookie name, e.g. 'session_id'."
    • addedInput schema / properties / path / description
      Added value: +"URL path the cookie applies to (default '/')."
    • addedInput schema / properties / sameSite / description
      Added value: +"SameSite policy: Strict, Lax, or None (None also requires secure: true). Omit for the browser default."
    • addedInput schema / properties / secure / description
      Added value: +"Only send the cookie over HTTPS."
    • addedInput schema / properties / value / description
      Added value: +"Cookie value."
  2. First observedv0.1.2

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so well: it discloses domain-scoping behavior, the deferred visibility of the cookie until the next request, and the replace-existing-name semantics. These are behaviors an agent could not infer otherwise.

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?

Nine short clauses that each add distinct operational information, front-loaded with the core action and followed by prerequisites and post-conditions. No redundant restatement of the tool name or schema.

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 an 8-parameter mutation tool with no annotations and no output schema, the description covers the essential behavioral context: prerequisite navigation, deferred cookie visibility, refresh requirement, and replacement semantics. Nothing an agent needs to call it correctly is missing.

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 all 8 parameters are fully documented in the schema with examples (e.g., '.example.com' for domain, Unix timestamp for expiry). The description elaborates on the domain/current-page constraint but adds no per-parameter syntax beyond what the schema already provides. Baseline 3 is correct.

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 ('Set a cookie in the browser') with concrete examples of intent (session, feature-flag, skip login). Clearly distinguishes from the sibling get_cookies and delete_cookie mutators.

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?

Provides explicit when-to-use examples and a critical prerequisite ('navigate to a page on that domain first'). Also states the post-condition action ('refresh or navigate afterwards') so the agent knows what to do next.

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