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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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()
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('清除' - clear/delete) which implies a destructive operation, but doesn't specify what 'saved cookies' means (e.g., from previous sessions, all cookies, or selective), whether this affects browser state, or if it requires specific permissions. The return statement is vague ('清除结果' - clear result) without indicating success/failure format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief (two lines) but could be more structured. The first line states the purpose clearly, but the 'Returns:' line adds minimal value since an output schema exists. While not verbose, it doesn't efficiently use space to include helpful context like when to use the tool or what 'saved cookies' entails.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, output schema provided) and lack of annotations, the description is minimally adequate. It states the action but misses important context: what 'saved cookies' are, whether this is destructive (implied but not explicit), and how it interacts with sibling tools. The output schema reduces the need to describe return values, but behavioral aspects are underspecified.

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 tool has 0 parameters with 100% schema description coverage (empty schema). The description doesn't need to explain parameters, and it correctly doesn't mention any. This meets the baseline of 4 for zero-parameter tools, as there's no parameter information to add beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('清除已保存的 Cookie' - clear saved cookies) and the resource (cookies), making the purpose immediately understandable. It doesn't explicitly differentiate from siblings like 'save_cookies_from_browser', but the verb 'clear' vs 'save' provides inherent distinction. The description avoids tautology by not just restating the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., requiring saved cookies to exist), when it should be used (e.g., after testing, for cleanup), or how it relates to siblings like 'save_cookies_from_browser' or 'browser_login'. The agent must infer usage from the tool name alone.

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

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