Skip to main content
Glama
al-one

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

企业微信应用号-发送图文卡片消息

wework_app_send_news

Send rich media card notifications to WeChat Work app users with title, link, image, and description for team alerts or announcements.

Instructions

通过企业微信应用号发送图文卡片消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes标题,不超过128个字符
urlYes跳转链接,最长2048字节,必须包含协议头(http/https)
picurlNo图片URL
descriptionNo描述,不超过512个字符
touserNo接收消息的成员ID,多个用`|`分隔,为`@all`时向该企业应用全部成员发送,默认从环境变量获取

Implementation Reference

  • The handler function implementing the 'wework_app_send_news' tool, decorated with @mcp.tool for direct registration. Sends a news card message to WeWork enterprise app users via POST request to the messaging API using cached access token.
    @mcp.tool(
        title="企业微信应用号-发送图文卡片消息",
        description="通过企业微信应用号发送图文卡片消息",
    )
    def wework_app_send_news(
        title: str = Field(description="标题,不超过128个字符"),
        url: str = Field(description="跳转链接,最长2048字节,必须包含协议头(http/https)"),
        picurl: str = Field("", description="图片URL"),
        description: str = Field("", description="描述,不超过512个字符"),
        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": "news",
                "news": {
                    "articles": [
                        {
                            "title": title,
                            "description": description,
                            "url": url,
                            "picurl": picurl,
                        },
                    ],
                },
            },
        )
        return res.json() or {}
  • Input schema and parameter definitions for the wework_app_send_news tool using Pydantic Field with descriptions and constraints.
    def wework_app_send_news(
        title: str = Field(description="标题,不超过128个字符"),
        url: str = Field(description="跳转链接,最长2048字节,必须包含协议头(http/https)"),
        picurl: str = Field("", description="图片URL"),
        description: str = Field("", description="描述,不超过512个字符"),
        touser: str = FIELD_TO_USER,
  • Registration of the MCP server instance and explicit call to add_tools from wework module, which registers the wework_app_send_news tool among others.
    mcp = FastMCP(name="mcp-notify", version="0.1.8")
    wework.add_tools(mcp)
  • Supporting helper function that caches and retrieves the WeWork application access token, essential for authenticating API calls in the send_news handler.
    @cached(TTLCache(maxsize=1, ttl=3600))
    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 for behavioral disclosure. While '发送' (send) implies a write operation, the description doesn't mention authentication requirements, rate limits, error conditions, or what happens on success/failure. For a messaging tool with zero annotation coverage, this leaves significant behavioral gaps.

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 states exactly what the tool does without unnecessary words. It's appropriately sized and front-loaded with the core functionality.

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 messaging tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after sending (success indicators, error responses), doesn't mention authentication or permissions needed, and provides no context about when to use this versus other messaging formats. The 100% schema coverage helps with parameters but doesn't compensate for the missing behavioral context.

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 already documents all 5 parameters thoroughly with constraints like character limits and format requirements. The description adds no additional parameter information beyond what's in the schema, which meets the baseline expectation when schema coverage is complete.

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 ('发送图文卡片消息' - send graphic card message) and resource ('通过企业微信应用号' - via WeWork app), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'wework_send_news' or 'wework_app_send_text', which is a minor gap.

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?

No guidance is provided about when to use this tool versus alternatives. With multiple WeWork messaging tools available (text, image, video, file, voice, and another news tool), the description offers no context about when this specific graphic card message format is appropriate compared to other message types.

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