Skip to main content
Glama
al-one

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

企业微信应用号-发送视频消息

wework_app_send_video

Send video messages via WeChat Work application to specified users or all members using video URLs, enabling video notifications across multiple platforms.

Instructions

通过企业微信应用号发送发送视频消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes视频URL
touserNo接收消息的成员ID,多个用`|`分隔,为`@all`时向该企业应用全部成员发送,默认从环境变量获取

Implementation Reference

  • The main handler function for the 'wework_app_send_video' tool. It takes video URL and optional touser, then delegates to the wework_send_media helper. Includes schema via pydantic Field descriptions.
    @mcp.tool(
        title="企业微信应用号-发送视频消息",
        description="通过企业微信应用号发送发送视频消息",
    )
    def wework_app_send_video(
        url: str = Field(description="视频URL"),
        touser: str = FIELD_TO_USER,
    ):
        return wework_send_media(touser, url, "video")
  • Core helper function that implements the media sending logic: downloads media from URL, uploads to WeWork media API using get_access_token, then sends the message using the media_id. Used by wework_app_send_video and similar tools.
    def wework_send_media(touser, url: str, msgtype=None):
        if msgtype:
            pass
        elif '.jpg' in url.lower() or '.jpeg' in url.lower() or '.png' in url.lower():
            msgtype = 'image'
        elif '.mp4' in url.lower():
            msgtype = 'video'
        elif '.arm' in url.lower():
            msgtype = 'voice'
        else:
            msgtype = 'file'
        res = requests.get(url, timeout=120)
        res.raise_for_status()
        file = io.BytesIO(res.content)
        mine = res.headers.get("content-type") or "application/octet-stream"
        res = requests.post(
            f"{WEWORK_BASE_URL}/cgi-bin/media/upload",
            params={"type": msgtype, "access_token": get_access_token()},
            files={"media": ("filename", file, mine)},
            timeout=120,
        )
        media = res.json() or {}
        if not (media_id := media.get("media_id")):
            return media
        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: {"media_id": media_id},
            },
        )
        return res.json()
  • Calls add_tools from wework.py module to register all WeWork tools, including 'wework_app_send_video', on the FastMCP instance.
    wework.add_tools(mcp)
  • Cached helper function to retrieve WeWork access token, used in media upload and message sending.
    @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. It states the tool sends video messages but lacks details on behavioral traits: no mention of authentication requirements (implied by '企业微信应用号' but not explicit), rate limits, error handling, or what happens on success/failure. The description is minimal and does not compensate for the absence of annotations, leaving key operational aspects unclear.

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 in Chinese that directly states the tool's function without redundancy. It is front-loaded with the core action and resource, making it easy to parse. There is no wasted verbiage, and it earns its place by clearly conveying the purpose in minimal words.

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 lacks details on behavioral aspects (e.g., authentication, side effects), usage context relative to siblings, and expected outcomes. While the schema covers parameters well, the overall context for safe and effective tool invocation is insufficient, especially for a mutation operation in a multi-tool environment.

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%, with both parameters (url, touser) well-documented in the schema. The description adds no additional parameter semantics beyond what the schema provides (e.g., no extra context on URL formats or user ID handling). Given high schema coverage, the baseline score of 3 is appropriate, as the description doesn't enhance parameter understanding but doesn't need to compensate for gaps.

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 video message) and the target resource ('通过企业微信应用号' - via WeWork app). It distinguishes from sibling tools like wework_app_send_text or wework_app_send_image by specifying video content, though it doesn't explicitly differentiate from wework_app_send_file which could also handle videos. The purpose is specific but could be more precise about uniqueness.

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 message types (e.g., wework_app_send_text, wework_app_send_image, wework_send_video) and platforms (e.g., tg_send_video, ding_send_text), there is no indication of context, prerequisites, or exclusions. Usage is implied only by the tool name and description, lacking explicit when/when-not instructions.

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