Skip to main content
Glama
cluic
by cluic

get_chat_info

Retrieve current chat window details including participants and conversation context for WeChat automation workflows.

Instructions

获取当前聊天窗口信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool registration using @tool decorator with name and description
    @tool(
        name="get_chat_info",
        description="获取当前聊天窗口信息"
    )
  • Handler function that retrieves and formats chat information from WeChatWrapper
    def get_chat_info() -> str:
        """
        获取当前聊天信息
    
        Returns:
            JSON 格式的聊天信息
        """
        wrapper = _get_wrapper()
        if not wrapper:
            return format_result(False, "微信未初始化")
    
        try:
            info = wrapper.get_chat_info()
            if not info:
                return format_result(False, "无法获取聊天信息")
    
            return format_result(True, "获取成功", {"chat_info": info})
        except Exception as e:
            logger.error(f"获取聊天信息失败: {e}")
            return format_result(False, f"获取聊天信息失败: {e}")
  • Core implementation that calls wxautox4's ChatInfo() method to retrieve current chat window information
    @require_online
    def get_chat_info(self) -> dict[str, Any]:
        """
        获取当前聊天信息
    
        Returns:
            dict: 聊天信息
        """
        try:
            return self.wx.ChatInfo()
        except Exception as e:
            logger.error(f"获取聊天信息失败: {e}")
            return {}

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/cluic/wxauto-mcp'

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