Skip to main content
Glama
al-one

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

企业微信应用号-发送文本消息

wework_app_send_text

Send text or Markdown messages to WeChat Work application users for notifications and alerts.

Instructions

通过企业微信应用号发送文本或Markdown消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes消息内容,最长不超过2048个字节
msgtypeNo内容类型,仅支持: text/markdowntext
touserNo接收消息的成员ID,多个用`|`分隔,为`@all`时向该企业应用全部成员发送,默认从环境变量获取

Implementation Reference

  • The handler function for the 'wework_app_send_text' tool. It sends a text or markdown message to WeWork enterprise app users via the API endpoint /cgi-bin/message/send, using a cached access token.
    def wework_app_send_text(
        text: str = Field(description="消息内容,最长不超过2048个字节"),
        msgtype: str = Field("text", description="内容类型,仅支持: text/markdown"),
        touser: str = FIELD_TO_USER,
    ):
        res = requests.post(
            f"{WEWORK_BASE_URL}/cgi-bin/message/send?access_token={get_access_token()}",
            json={
                "touser": touser or WEWORK_APP_TOUSER,
                "agentid": WEWORK_APP_AGENTID,
                "msgtype": msgtype,
                msgtype: {"content": text},
                "enable_duplicate_check": 1,
                "duplicate_check_interval": 60,
            },
        )
        return res.json() or {}
  • Registers the 'wework_app_send_text' tool with FastMCP using the @mcp.tool decorator inside the add_tools function.
    @mcp.tool(
        title="企业微信应用号-发送文本消息",
        description="通过企业微信应用号发送文本或Markdown消息",
    )
  • Top-level call to add_tools from the wework module, which registers the 'wework_app_send_text' tool among others to the FastMCP instance.
    wework.add_tools(mcp)
  • Cached helper function to obtain the WeWork access token required by the wework_app_send_text handler.
    def get_access_token():
        res = requests.get(
            f"{WEWORK_BASE_URL}/cgi-bin/gettoken",
            params={"corpid": WEWORK_APP_CORPID, "corpsecret": WEWORK_APP_SECRET},
            timeout=60,
        )
        return res.json().get("access_token")
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions sending messages but lacks critical behavioral details: no information on authentication requirements (implied by '企业微信应用号' but not explicit), rate limits, error handling, or what happens on success/failure. The description is minimal and doesn't compensate for the absence of annotations.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose without any wasted words. It directly states the tool's function, making it easy to parse and understand quickly.

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?

Given the complexity of a messaging tool with no annotations and no output schema, the description is incomplete. It doesn't address authentication, response format, error conditions, or usage context relative to siblings. For a tool that performs an action (sending messages), more behavioral and contextual information is needed for an agent to use it effectively.

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 schema fully documents all parameters (text, msgtype, touser). The description adds no additional meaning beyond implying text/markdown support, which is already in the schema. Baseline 3 is appropriate as the schema does the heavy lifting, but the description doesn't enhance parameter understanding.

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 the action ('发送文本或Markdown消息') and resource ('通过企业微信应用号'), making the purpose immediately understandable. It distinguishes from siblings like 'wework_app_send_file' or 'wework_app_send_image' by specifying text/markdown content types, though it doesn't explicitly contrast with 'wework_send_text' (which appears to be a different variant).

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. With many sibling tools for different messaging platforms (e.g., 'ding_send_text', 'lark_send_text') and content types (e.g., 'wework_app_send_file'), there is no indication of context, prerequisites, or trade-offs to help an agent choose appropriately.

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