Skip to main content
Glama

wework_send_news

Send rich link messages with titles, images, and descriptions to WeWork group chats using bot integration for team notifications and updates.

Instructions

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

Input Schema

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

Implementation Reference

  • The handler function that implements the core logic of sending a news (link article) message via WeWork group robot webhook using requests.post to the API endpoint.
    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()
  • The @mcp.tool decorator registers the wework_send_news function as an MCP tool with title and description.
    @mcp.tool( title="企业微信群机器人-发送图文消息", description="通过企业微信群机器人发送图文链接消息", )
  • Calls add_tools from wework module on the FastMCP instance, which defines and registers the wework_send_news tool among others.
    wework.add_tools(mcp)
  • Pydantic Field definition for the bot_key parameter, providing default and description used in the tool schema.
    FIELD_BOT_KEY = Field("", description="企业微信群机器人key,uuid格式,默认从环境变量获取")
  • Base URL constant for WeWork API endpoints, used in the handler.
    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/aahl/mcp-notify'

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