Skip to main content
Glama
goesByhc
by goesByhc

harvest_cookies

Extracts cookies from your own browser session via Chrome DevTools Protocol, including HttpOnly cookies, to enable authenticated scraping of Chinese platforms. Requires the browser to be running on a specified port.

Instructions

从用户自己的浏览器会话中自动提取 cookie(包括 HttpOnly cookie)。

通过 Chrome DevTools Protocol (CDP) 的 Network.getAllCookies 提取 浏览器 cookie jar 中的所有 cookie(含 HttpOnly,这是 JS 无法获取的)。 仅提取用户自己的浏览器会话——浏览器须已在指定端口运行且已登录。

非 profile 平台的 Cookie 保存到认证注册表指定的 JSON 文件。 京东使用持久化 Chrome profile,请改用 guided_login。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoCDP 调试端口 (可选, 各平台有默认值)
platformYes认证注册表中的平台名。京东会返回 profile_required。

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries the burden. It explains the mechanism (CDP Network.getAllCookies), the privacy scope (only the user's own session), side effects (saves to a JSON file specified by the auth registry), and a platform exception. Missing details about error behavior when the port isn't running, but the presence of an output schema reduces the need.

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?

Four sentences, each earning its place: main action, method/conditions, file saving behavior, and the JD exception. Front-loaded with purpose, no filler.

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 output schema exists, the description needn't explain return values. It covers purpose, prerequisites, side effects, and a special case. Could be slightly more explicit about how this tool relates to check_cookies/verify_login, but that's not essential for invoking it.

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?

The input schema already fully documents both parameters (100% coverage), so baseline is 3. The description adds contextual value by stating that the browser must be running on the specified port and that JD returns profile_required, linking the port and platform parameters to real-world behavior.

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 opens with a specific verb+resource: '自动提取 cookie (including HttpOnly)' from the user's own browser session. It clearly distinguishes itself from sibling guided_login by noting that JD requires a persistent Chrome profile and should use guided_login instead.

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?

It explicitly states the when-not-to-use: for JD (persistent Chrome profile), use guided_login. It also gives prerequisites: browser must be running on the specified port and logged in. This provides clear usage context versus alternatives.

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/goesByhc/cn-scraper-mcp'

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