Skip to main content
Glama

企业微信群机器人-发送图文消息

wework_send_news

Send a news link message to a WeWork group via bot. Supports title, URL, optional image and description.

Instructions

通过企业微信群机器人发送图文链接消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes标题,不超过128个字节
urlYes跳转链接,必填
picurlNo图片URL
descriptionNo描述,不超过512个字节
bot_keyNo企业微信群机器人key,uuid格式,默认从环境变量获取

Implementation Reference

  • The handler function for the 'wework_send_news' tool. It sends a news (图文) message via a WeWork group bot webhook. Parameters: title, url, picurl (optional), description (optional), bot_key (optional, defaults to env).
    def wework_send_news(
        title: str = Field(description="标题,不超过128个字节"),
        url: str = Field(description="跳转链接,必填"),
        picurl: str = Field("", description="图片URL"),
        description: str = Field("", description="描述,不超过512个字节"),
        bot_key: str = FIELD_BOT_KEY,
    ):
        res = requests.post(
            f"{WEWORK_BASE_URL}/cgi-bin/webhook/send?key={bot_key or WEWORK_BOT_KEY}",
            json={
                "msgtype": "news",
                "news": {
                    "articles": [
                        {
                            "title": title,
                            "description": description,
                            "url": url,
                            "picurl": picurl,
                        },
                    ],
                },
            },
        )
        return res.json()
  • The @mcp.tool decorator that registers 'wework_send_news' as an MCP tool. The decorator provides the tool's title and description.
    @mcp.tool(
        title="企业微信群机器人-发送图文消息",
        description="通过企业微信群机器人发送图文链接消息",
    )
  • Input parameters/schema for wework_send_news using Pydantic Field descriptors. Parameters: title (required), url (required), picurl (optional, default ''), description (optional, default ''), bot_key (optional, defaults to FIELD_BOT_KEY which reads from env).
    def wework_send_news(
        title: str = Field(description="标题,不超过128个字节"),
        url: str = Field(description="跳转链接,必填"),
        picurl: str = Field("", description="图片URL"),
        description: str = Field("", description="描述,不超过512个字节"),
        bot_key: str = FIELD_BOT_KEY,
  • The FIELD_BOT_KEY helper constant used as the default for bot_key parameter. Reads from environment or defaults to empty string.
    FIELD_BOT_KEY = Field("", description="企业微信群机器人key,uuid格式,默认从环境变量获取")
    FIELD_TO_USER = Field("", description="接收消息的成员ID,多个用`|`分隔,为`@all`时向该企业应用全部成员发送,默认从环境变量获取")
  • The 'add_tools' function is called from __init__.py to register all WeWork tools including wework_send_news onto the FastMCP instance.
    def add_tools(mcp: FastMCP, logger=None):
    
        @mcp.tool(
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses the action (send via bot) but omits details like rate limits, error handling, or role of bot_key. Adequate but minimal.

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?

Single sentence, no redundancy, front-loaded with key action. Efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema and no annotations; description only covers purpose. Lacks details on bot_key derivation, error responses, or usage constraints. Adequate for simple tool but not comprehensive.

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?

Input schema covers all 5 parameters with descriptions (100% coverage). Description adds no additional meaning beyond schema, baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the verb (发送/send), resource (企业微信群机器人/WeWork group robot), and message type (图文链接消息/image-text link message), differentiating it from siblings like wework_send_text and wework_send_image.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like wework_app_send_news or other messaging tools. Usage is implied by the description, but no when-not-to-use or context is provided.

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/aahl/mcp-notify'

If you have feedback or need assistance with the MCP directory API, please join our Discord server