Skip to main content
Glama
al-one

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

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

wework_app_send_image

Send an image message to WeChat Work users by providing a URL. Optionally specify target users or use @all to notify everyone.

Instructions

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

Input Schema

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

Implementation Reference

  • The 'wework_app_send_image' tool handler function. It downloads an image from a URL and delegates to 'wework_send_media' with msgtype='image'. Registered as an MCP tool via @mcp.tool decorator.
    def wework_app_send_image(
        url: str = Field(description="图片URL"),
        touser: str = FIELD_TO_USER,
    ):
        return wework_send_media(touser, url, "image")
  • The 'wework_send_media' helper function called by 'wework_app_send_image'. Downloads media from a URL, uploads it to WeWork's media API, then sends it as an application message with the returned media_id.
    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()
  • Registration point: 'wework.add_tools(mcp)' is called, which registers all WeWork tools including 'wework_app_send_image' via the @mcp.tool decorator inside the add_tools function.
    mcp = FastMCP(name="mcp-notify", version="0.1.11")
    wework.add_tools(mcp)
    tgbot.add_tools(mcp)
    other.add_tools(mcp)
    hass.add_tools(mcp)
    util.add_tools(mcp)
  • Schema definition: The 'FIELD_TO_USER' constant is used as a default value for the 'touser' parameter in 'wework_app_send_image', defining its input schema.
    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?

With no annotations, the description must disclose behavioral traits but only states the action. It omits details like authentication needs, delivery guarantees, error handling, or what happens when the user ID is invalid. This is insufficient for an agent to reason about side effects.

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

Conciseness3/5

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

The description is a single short sentence, which is concise, but it contains a typographical error (repeated '发送'). It is front-loaded but the error reduces clarity and professionalism. For a single-sentence description, it should be flawless.

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 (2 parameters, no output schema, no annotations), the description is too sparse. It does not explain the return value, error cases, or distinguish from siblings effectively. More context is needed for an agent to use it reliably.

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?

The schema covers 100% of parameters with descriptions, so the baseline is 3. The tool description adds no extra parameter context beyond the schema, but it does not need to since the schema is clear. No information is contradicted or omitted.

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: sending an image message via the WeChat Work app number. It uses a verb+resource pattern and distinguishes from sibling tools like wework_send_image by specifying '应用号' (app number). The duplication '发送发送' is a minor typo but does not obscure purpose.

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 on when to use this tool versus alternatives such as wework_app_send_text or wework_send_image. The description lacks context about prerequisites, target audience, or scenarios, leaving the agent to guess.

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