Skip to main content
Glama
al-one

MCP Server for notify to weixin / telegram / bark / lark

wework_send_text

Send text or Markdown messages to WeCom group chats using bot integration for team notifications and alerts.

Instructions

通过企业微信群机器人发送文本或Markdown消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bot_keyNo企业微信群机器人key,uuid格式,默认从环境变量获取
msgtypeNo内容类型,仅支持: text/markdown_v2text
textYes消息内容,长度限制: (text: 2048个字节, markdown_v2: 4096个字节)

Implementation Reference

  • The handler function that implements the logic to send text or markdown_v2 messages to WeWork group robot via webhook.
    def wework_send_text( text: str = Field(description="消息内容,长度限制: (text: 2048个字节, markdown_v2: 4096个字节)"), msgtype: str = Field("text", description="内容类型,仅支持: text/markdown_v2"), bot_key: str = FIELD_BOT_KEY, ): if msgtype == "markdown": msgtype = "markdown_v2" res = requests.post( f"{WEWORK_BASE_URL}/cgi-bin/webhook/send?key={bot_key or WEWORK_BOT_KEY}", json={"msgtype": msgtype, msgtype: {"content": text}}, ) return res.json()
  • Pydantic Field definitions for the tool's input parameters: text, msgtype, bot_key.
    text: str = Field(description="消息内容,长度限制: (text: 2048个字节, markdown_v2: 4096个字节)"), msgtype: str = Field("text", description="内容类型,仅支持: text/markdown_v2"), bot_key: str = FIELD_BOT_KEY, ):
  • The @mcp.tool decorator that registers wework_send_text as an MCP tool with title and description.
    @mcp.tool( title="企业微信群机器人-发送文本消息", description="通过企业微信群机器人发送文本或Markdown消息", )
  • Creation of FastMCP server instance and invocation of add_tools from wework (and other modules) to register the tools.
    mcp = FastMCP(name="mcp-notify", version="0.1.7") wework.add_tools(mcp) tgbot.add_tools(mcp) other.add_tools(mcp) hass.add_tools(mcp) util.add_tools(mcp)
  • Environment variable constants used by the wework_send_text tool and other WeWork functions.
    WEWORK_BOT_KEY = os.getenv("WEWORK_BOT_KEY", "") WEWORK_APP_AGENTID = int(os.getenv("WEWORK_APP_AGENTID", 1000002)) WEWORK_APP_CORPID = os.getenv("WEWORK_APP_CORPID", "") WEWORK_APP_SECRET = os.getenv("WEWORK_APP_SECRET", "") WEWORK_APP_TOUSER = os.getenv("WEWORK_APP_TOUSER", "@all") WEWORK_BASE_URL = os.getenv("WEWORK_BASE_URL") or "https://qyapi.weixin.qq.com"

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/al-one/mcp-notify'

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