wework_send_news
Send rich media messages with titles, links, and images to WeChat Work group chats using webhook integration for team notifications and announcements.
Instructions
通过企业微信群机器人发送图文链接消息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bot_key | No | 企业微信群机器人key,uuid格式,默认从环境变量获取 | |
| description | No | 描述,不超过512个字节 | |
| picurl | No | 图片URL | |
| title | Yes | 标题,不超过128个字节 | |
| url | Yes | 跳转链接,必填 |
Implementation Reference
- mcp_notify/wework.py:64-91 (handler)Handler function for 'wework_send_news' tool: sends news (link article) message via WeWork group robot webhook API using provided title, url, picurl, description, and bot_key.@mcp.tool( title="企业微信群机器人-发送图文消息", description="通过企业微信群机器人发送图文链接消息", ) def wework_send_news( title: str = Field(description="标题,不超过128个字节"), url: str = Field(description="跳转链接,必填"), picurl: str = Field("", description="图片URL"), description: str = Field("", description="描述,不超过512个字节"), bot_key: str = FIELD_BOT_KEY, ): res = requests.post( f"{WEWORK_BASE_URL}/cgi-bin/webhook/send?key={bot_key or WEWORK_BOT_KEY}", json={ "msgtype": "news", "news": { "articles": [ { "title": title, "description": description, "url": url, "picurl": picurl, }, ], }, }, ) return res.json()
- mcp_notify/__init__.py:19-19 (registration)Registration of WeWork tools (including wework_send_news) by calling add_tools on the FastMCP instance.wework.add_tools(mcp)
- mcp_notify/wework.py:69-73 (schema)Pydantic Field definitions for input parameters of the wework_send_news tool, defining schema with descriptions and defaults.title: str = Field(description="标题,不超过128个字节"), url: str = Field(description="跳转链接,必填"), picurl: str = Field("", description="图片URL"), description: str = Field("", description="描述,不超过512个字节"), bot_key: str = FIELD_BOT_KEY,