Skip to main content
Glama

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

wework_send_text

Send text or Markdown messages to a WeWork group chat using a bot key. Supports up to 2048 bytes for text and 4096 bytes for Markdown.

Instructions

通过企业微信群机器人发送文本或Markdown消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes消息内容,长度限制: (text: 2048个字节, markdown_v2: 4096个字节)
msgtypeNo内容类型,仅支持: text/markdown_v2text
bot_keyNo企业微信群机器人key,uuid格式,默认从环境变量获取

Implementation Reference

  • The handler function for the 'wework_send_text' tool. Sends a text or markdown message via a WeWork (企业微信) group bot webhook. Accepts text content, msgtype (text/markdown_v2), and an optional bot_key. Makes a POST request to the WeWork webhook API and returns the response JSON.
    def wework_send_text(
        text: str = Field(description="消息内容,长度限制: (text: 2048个字节, markdown_v2: 4096个字节)"),
        msgtype: str = Field("text", description="内容类型,仅支持: text/markdown_v2"),
        bot_key: str = FIELD_BOT_KEY,
    ):
        if msgtype == "markdown":
            msgtype = "markdown_v2"
        res = requests.post(
            f"{WEWORK_BASE_URL}/cgi-bin/webhook/send?key={bot_key or WEWORK_BOT_KEY}",
            json={"msgtype": msgtype, msgtype: {"content": text}},
        )
        return res.json()
  • The tool registration decorator (@mcp.tool) for 'wework_send_text', with title '企业微信群机器人-发送文本消息' and description '通过企业微信群机器人发送文本或Markdown消息'.
    @mcp.tool(
        title="企业微信群机器人-发送文本消息",
        description="通过企业微信群机器人发送文本或Markdown消息",
    )
  • Registration of the wework tools module into the main FastMCP server via wework.add_tools(mcp).
    mcp = FastMCP(name="mcp-notify", version="0.1.11")
    wework.add_tools(mcp)
  • Pydantic Field definitions for the tool's parameters: 'text' (message content), 'msgtype' (text/markdown_v2), and 'bot_key' (WeWork bot key with environment variable fallback).
        text: str = Field(description="消息内容,长度限制: (text: 2048个字节, markdown_v2: 4096个字节)"),
        msgtype: str = Field("text", description="内容类型,仅支持: text/markdown_v2"),
        bot_key: str = FIELD_BOT_KEY,
    ):
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 only states the basic action (sends text/Markdown) without disclosing side effects, permissions, rate limits, error handling, or behavior on invalid bot_key. For a mutation tool, this is insufficient.

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

Conciseness4/5

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

The description is a single sentence that efficiently conveys the core purpose. It is front-loaded with the action. While concise, it could include slightly more context without becoming verbose.

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 multiple similar siblings and the lack of output schema, the description is incomplete. It does not explain prerequisites (e.g., obtaining bot_key), limitations (e.g., message length constraints already in schema), or integration context. The schema covers parameters, but behavioral context is missing.

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 parameters adequately. The description adds no new semantic information beyond reiterating the content types (text/markdown_v2). Baseline score of 3 is appropriate.

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 '发送文本或Markdown消息' (sends text or Markdown messages) via the WeWork group robot, which specifies the action, resource, and content type. However, it does not explicitly differentiate from sibling tools like wework_send_image or wework_send_news, though the content type provides implicit distinction.

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, such as other messaging tools (ding_send_text, lark_send_text) or other WeWork send tools. No prerequisites, authentication steps, or selection criteria are mentioned.

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