interceptor_chrome_devtools_get_cookie
Retrieve specific cookie details from Chrome DevTools sessions for network traffic analysis and debugging.
Instructions
Get one cookie by cookie_id with full value (subject to a hard cap to keep output bounded).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| devtools_session_id | Yes | Session ID from interceptor_chrome_devtools_attach | |
| cookie_id | Yes | cookie_id from interceptor_chrome_devtools_list_cookies | |
| value_max_chars | No | Max characters for cookie value (default: 20000) |
Implementation Reference
- src/tools/devtools.ts:884-938 (handler)The implementation of the tool "interceptor_chrome_devtools_get_cookie".
"interceptor_chrome_devtools_get_cookie", "Get one cookie by cookie_id with full value (subject to a hard cap to keep output bounded).", { devtools_session_id: z.string().describe("Session ID from interceptor_chrome_devtools_attach"), cookie_id: z.string().describe("cookie_id from interceptor_chrome_devtools_list_cookies"), value_max_chars: z.number().optional().default(HARD_VALUE_CAP_CHARS) .describe(`Max characters for cookie value (default: ${HARD_VALUE_CAP_CHARS})`), }, async ({ devtools_session_id, cookie_id, value_max_chars }) => { try { const session = devToolsBridge.getSession(devtools_session_id); if (!session) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: `DevTools session '${devtools_session_id}' not found.` }) }] }; } const { targetId } = await ensureSessionTargetIsAlive(devtools_session_id); const { pageUrl, wsUrl } = await getCdpPageEndpoint(targetId); const cookies = await cdpGetCookies(wsUrl, pageUrl); const found = cookies.find((c) => cookieStableId(c) === cookie_id) ?? null; if (!found) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: `Cookie '${cookie_id}' not found. Re-run list tool.` }), }], }; } const value = typeof found.value === "string" ? found.value : ""; const capped = capValue(value, Math.max(0, Math.min(HARD_VALUE_CAP_CHARS, Math.trunc(value_max_chars ?? HARD_VALUE_CAP_CHARS)))); return { content: [{ type: "text", text: truncateResult({ status: "success", devtools_session_id, target_id: targetId, cookie_id, cookie: { ...found, value: capped.value, }, value_length: capped.valueLength, value_truncated: capped.truncated, value_max_chars: capped.maxChars, }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: errorToString(e) }) }] }; } }, );