Skip to main content
Glama

wework_send_news

Send formatted news messages with titles, links, and images to WeWork group chats via bot integration for team communication and updates.

Instructions

通过企业微信群机器人发送图文链接消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes标题,不超过128个字节
urlYes跳转链接,必填
picurlNo图片URL
descriptionNo描述,不超过512个字节
bot_keyNo企业微信群机器人key,uuid格式,默认从环境变量获取

Implementation Reference

  • Handler function for the 'wework_send_news' tool. Uses WeWork (Enterprise WeChat) group robot webhook to send a news article message with title, description, URL, and optional picture.
    @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()
  • Top-level registration of WeWork tools (including wework_send_news) by calling add_tools from the wework module on the FastMCP instance.
    wework.add_tools(mcp)
  • Pydantic Field definitions in the function parameters providing input schema, validation, and descriptions for the tool.
    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()
  • Reusable Field definition for bot_key parameter used across WeWork bot tools.
    FIELD_BOT_KEY = Field("", description="企业微信群机器人key,uuid格式,默认从环境变量获取")

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