Skip to main content
Glama
Xuzan9396

YST KPI Daily Report Collector

by Xuzan9396

clear_saved_cookies

Remove stored authentication cookies to reset browser session state for the KPI daily report collection system.

Instructions

清除已保存的 Cookie

Returns: 清除结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @mcp.tool(), which creates a CookieManager instance and calls its clear_cookies method to clear saved cookies, returning success or failure message.
    @mcp.tool()
    async def clear_saved_cookies() -> str:
        """
        清除已保存的 Cookie
    
        Returns:
            清除结果
        """
        manager = CookieManager()
    
        try:
            if manager.clear_cookies():
                return safe_text("✓ Cookie 已清除")
            else:
                return safe_text("❌ 清除失败")
        except Exception as e:
            return safe_text(f"清除失败: {str(e)}")
  • The supporting helper method in CookieManager class that deletes the cookies.json file if it exists, returning True on success.
    def clear_cookies(self) -> bool:
        """
        清除保存的 Cookie
    
        Returns:
            是否清除成功
        """
        if os.path.exists(self.cookie_file):
            try:
                os.remove(self.cookie_file)
                return True
            except Exception as e:
                print(f"清除 Cookie 失败: {e}")
                return False
        return True
  • server.py:301-301 (registration)
    The @mcp.tool() decorator registers the clear_saved_cookies function as an MCP tool.
    @mcp.tool()

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/Xuzan9396/yst_mcp'

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