Skip to main content
Glama
muhenan

Xiaohongshu MCP Server

by muhenan

xiaohongshu_check_status

Check Xiaohongshu account login status using headless browser automation to verify authentication and access permissions.

Instructions

检查小红书登录状态

Args: headless: 是否使用无头模式,默认True(状态检查可使用无头模式) chrome_path: Chrome浏览器可执行文件路径,可选

Returns: 登录状态信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chrome_pathNo
headlessNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the xiaohongshu_check_status tool. It launches a browser, creates a XiaohongshuLogin instance, and checks the login status.
    @mcp.tool()
    async def xiaohongshu_check_status(
        headless: bool = True,
        chrome_path: Optional[str] = None
    ) -> str:
        """
        检查小红书登录状态
    
        Args:
            headless: 是否使用无头模式,默认True(状态检查可使用无头模式)
            chrome_path: Chrome浏览器可执行文件路径,可选
    
        Returns:
            登录状态信息
        """
        try:
            logger.info("检查小红书登录状态...")
    
            # 创建浏览器管理器
            browser_manager = BrowserManager(
                headless=headless,
                chrome_path=chrome_path
            )
    
            async with browser_manager.get_page() as page:
                # 创建登录处理器
                login_handler = XiaohongshuLogin(page)
    
                # 检查登录状态
                is_logged_in = await login_handler.check_login_status()
    
                if is_logged_in:
                    logger.success("✅ 已登录")
                    return "✅ 小红书已登录"
                else:
                    logger.info("❌ 未登录")
                    return "❌ 小红书未登录,请先执行登录操作"
    
        except Exception as e:
            error_msg = f"检查登录状态时发生错误: {e}"
            logger.error(error_msg)
            return f"❌ {error_msg}"
  • The @mcp.tool() decorator registers the xiaohongshu_check_status function as an MCP tool.
    @mcp.tool()
  • Input schema defined by function parameters (headless: bool, chrome_path: Optional[str]) and return str, with docstring describing the tool.
    async def xiaohongshu_check_status(
        headless: bool = True,
        chrome_path: Optional[str] = None
    ) -> str:
        """
        检查小红书登录状态
    
        Args:
            headless: 是否使用无头模式,默认True(状态检查可使用无头模式)
            chrome_path: Chrome浏览器可执行文件路径,可选
    
        Returns:
            登录状态信息
        """
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It implies a read-only operation (checking status) but doesn't disclose behavioral traits such as whether it requires prior login, potential rate limits, error handling, or what specific information is returned. The mention of headless mode adds some context but is insufficient for a mutation-sensitive tool.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded with the main purpose first, followed by parameter and return sections. It avoids unnecessary verbosity, though the structure could be slightly improved by integrating parameter notes more seamlessly.

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 moderate complexity (2 parameters, no annotations), the description is somewhat complete but has gaps. It covers the purpose and parameters but lacks usage guidelines and detailed behavioral context. The presence of an output schema reduces the need to explain return values, but more context on tool interaction is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning for both parameters: 'headless' is explained as whether to use headless mode with a default and usage note, and 'chrome_path' is noted as optional. However, it doesn't fully detail parameter constraints or examples, leaving gaps.

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 tool's purpose as '检查小红书登录状态' (check Xiaohongshu login status), which is a specific verb+resource combination. However, it doesn't explicitly distinguish this from sibling tools like 'xiaohongshu_login' (which likely performs login) or 'xiaohongshu_publish' (which likely publishes content), though the function is reasonably distinct by 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 like 'xiaohongshu_login' for logging in or 'xiaohongshu_publish' for publishing. It mentions that headless mode can be used for status checks, but this is more of a parameter hint than usage context.

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/muhenan/xiaohongshu-mcp-python'

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