cookies
Manage browser HTTP state: retrieve, build Cookie headers, set, or delete entries using URL, domain, and name filters for Playwright automation.
Instructions
Cookie management (v0.9.0 unified).
Replaces get_cookies / set_cookies / delete_cookies.
Args:
action:
"get" — return cookies (optionally filtered by url, domain, and/or name)
"header" — build a ready-to-use Cookie: header value (deduplicated by name)
"set" — set cookies (requires cookies_list: [{name, value, domain, ...}])
"delete" — delete cookies (filter by name and/or domain; no filter = clear all)
domain: Host or parent domain for get/header/delete (boundary match, includes subdomains).
With name, both filters must match. No filters on delete clears all cookies.
cookies_list: List of cookie dicts for "set".
name: Optional exact cookie name filter for get/header/delete.
url: Optional request URL for get/header so Playwright applies RFC 6265
domain, path, Secure, and expiry matching. When action="header" is called
without url or domain on an http(s) page, defaults to the active page URL.
output_file: For action="header", write the Cookie header to this file (mode 0600)
and omit the raw header string from the inline tool response.
overwrite: Allow replacing an existing output_file.
Returns: For "get": list of cookie dicts. For "header": {"action", "count", "names", "header", "domain", "url"} plus "output": {path, bytes, sha256, ...} (with "header": None) when output_file is used. For "set"/"delete": dict with status and count.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "cookies"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| name | No | ||
| action | Yes | ||
| domain | No | ||
| overwrite | No | ||
| output_file | No | ||
| cookies_list | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |