Skip to main content
Glama

wework_send_text

Send text or Markdown messages to WeWork group chats using a bot webhook. Configure bot keys and message types to deliver notifications through the enterprise messaging platform.

Instructions

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

Input Schema

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

Implementation Reference

  • The main handler function 'wework_send_text' decorated with @mcp.tool(), which sends text or markdown_v2 messages to WeWork group robot via webhook API.
    @mcp.tool( title="企业微信群机器人-发送文本消息", description="通过企业微信群机器人发送文本或Markdown消息", ) 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()
  • The registration call 'wework.add_tools(mcp)' which registers the wework_send_text tool (and others from wework.py) to the FastMCP instance.
    wework.add_tools(mcp)
  • Pydantic Field definitions for the input parameters of the wework_send_text tool, defining schema and validation.
    text: str = Field(description="消息内容,长度限制: (text: 2048个字节, markdown_v2: 4096个字节)"), msgtype: str = Field("text", description="内容类型,仅支持: text/markdown_v2"), bot_key: str = FIELD_BOT_KEY, ):
  • Creation of the FastMCP server instance where tools are registered.
    mcp = FastMCP(name="mcp-notify", version="0.1.8")
  • Reusable Pydantic Field definitions used in tool parameters for bot_key and to_user.
    FIELD_BOT_KEY = Field("", description="企业微信群机器人key,uuid格式,默认从环境变量获取") FIELD_TO_USER = Field("", description="接收消息的成员ID,多个用`|`分隔,为`@all`时向该企业应用全部成员发送,默认从环境变量获取")

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

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