Skip to main content
Glama

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
NameRequiredDescriptionDefault
devtools_session_idYesSession ID from interceptor_chrome_devtools_attach
cookie_idYescookie_id from interceptor_chrome_devtools_list_cookies
value_max_charsNoMax characters for cookie value (default: 20000)

Implementation Reference

  • 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) }) }] };
        }
      },
    );

Tool Definition Quality

Score is being calculated. Check back soon.

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/yfe404/proxy-mcp'

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