Skip to main content
Glama
al-one

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

企业微信群机器人-发送文本消息

wework_send_text

Send text or Markdown notifications to WeChat Work groups using a bot key. Message length limits: 2048 bytes for text, 4096 for Markdown.

Instructions

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

Input Schema

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

Implementation Reference

  • The handler function for the 'wework_send_text' tool. Sends a text or Markdown message via the WeWork (WeCom) group robot webhook API.
    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()
  • Registration of wework_send_text as an MCP tool via the @mcp.tool decorator, with title and description.
    @mcp.tool(
        title="企业微信群机器人-发送文本消息",
        description="通过企业微信群机器人发送文本或Markdown消息",
    )
  • Input schema/parameters for wework_send_text: text (message content), msgtype (text or markdown_v2), bot_key (bot webhook key).
    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,
    ):
  • Configuration constants and shared Field definitions used by wework_send_text and other tools.
    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"
    
    FIELD_BOT_KEY = Field("", description="企业微信群机器人key,uuid格式,默认从环境变量获取")
    FIELD_TO_USER = Field("", description="接收消息的成员ID,多个用`|`分隔,为`@all`时向该企业应用全部成员发送,默认从环境变量获取")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility. It mentions sending text/Markdown but omits details like rate limits, authentication (bot_key required but may fallback to env var), or message length constraints (partially covered in schema). The description is insufficient for full behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no wasted words. However, it could be slightly more informative without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with three parameters and no output schema, the description is minimal. It does not explain the purpose of bot_key or msgtype defaults, nor how it differs from WeWork sibling tools (e.g., wework_send_news). More context is needed for an agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description does not add any parameter information beyond what is in the schema. The schema descriptions are adequate, but the description itself contributes nothing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool sends text or Markdown messages via the WeWork group robot. It distinguishes from sibling tools targeting other platforms (e.g., DingTalk, Lark), but does not explicitly differentiate from other WeWork-specific tools like wework_send_image.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, nor does it mention prerequisites or exclusions. It only describes the basic function without context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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