Skip to main content
Glama
al-one

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

企业微信应用号-发送语音消息

wework_app_send_voice

Send voice messages through WeChat Work applications to specified users or all members using voice URLs for notifications.

Instructions

通过企业微信应用号发送发送语音消息

Input Schema

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

Implementation Reference

  • The handler function decorated with @mcp.tool that defines and registers the 'wework_app_send_voice' tool. It takes a voice URL and target user, and delegates to the shared media sender.
    @mcp.tool(
        title="企业微信应用号-发送语音消息",
        description="通过企业微信应用号发送发送语音消息",
    )
    def wework_app_send_voice(
        url: str = Field(description="语音URL"),
        touser: str = FIELD_TO_USER,
    ):
        return wework_send_media(touser, url, "voice")
  • Helper function that handles downloading media from URL, auto-detecting type if not provided, uploading to WeWork media endpoint, and sending the message via the application agent.
    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()
  • Invocation of add_tools which defines and registers the wework_app_send_voice tool (along with others) to the MCP server instance.
    wework.add_tools(mcp)
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 voice messages but doesn't disclose behavioral traits like authentication requirements, rate limits, error handling, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is a significant gap.

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 purpose without any fluff or redundancy. 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?

Given this is a mutation tool (sending messages) with no annotations and no output schema, the description is incomplete. It doesn't cover what the tool returns, error conditions, authentication needs, or practical usage context. For a tool that modifies state in a messaging system, more behavioral information is needed.

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 both parameters (url and touser). The description doesn't add any parameter semantics beyond what the schema provides, such as explaining URL format requirements or touser usage scenarios. Baseline 3 is appropriate when schema does the heavy lifting.

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 voice message) and resource ('通过企业微信应用号' - via WeWork app). It distinguishes from siblings like wework_app_send_text and wework_app_send_file by specifying voice messages. However, it doesn't explicitly mention the verb 'send' in English context, though the Chinese is clear.

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 on when to use this tool versus alternatives is provided. The description doesn't mention when to choose voice messages over text, file, or other media types available in sibling tools, nor does it discuss prerequisites or typical use cases.

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