Skip to main content
Glama
al-one

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

钉钉群机器人-发送文本消息

ding_send_text

Send text or Markdown messages to DingTalk group robots via Webhook. Configure the bot access token through environment variable or direct input.

Instructions

钉钉群机器人发送文本或Markdown消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes消息内容
titleNo消息标题
msgtypeNo内容类型,仅支持: text/markdownmarkdown
bot_keyNo钉钉群机器人access_token,默认从环境变量获取

Implementation Reference

  • The handler function that executes the ding_send_text tool logic. It accepts text, title, msgtype, and bot_key parameters, builds the request body based on msgtype (markdown or text), retrieves the bot token from parameter or DINGTALK_BOT_KEY env var, and sends a POST request to DingTalk's robot API endpoint, returning the JSON response.
    def ding_send_text(
        text: str = Field(description="消息内容"),
        title: str = Field("", description="消息标题"),
        msgtype: str = Field("markdown", description="内容类型,仅支持: text/markdown"),
        bot_key: str = Field("", description="钉钉群机器人access_token,默认从环境变量获取"),
    ):
        """
        https://open.dingtalk.com/document/development/custom-robots-send-group-messages
        """
        if msgtype == "markdown":
            body = {"title": title, "text": text}
        else:
            body = {"content": f'{title}\n{text}'.strip()}
        if not bot_key:
            bot_key = os.getenv("DINGTALK_BOT_KEY", "")
        base = os.getenv("DINGTALK_BASE_URL") or "https://oapi.dingtalk.com"
        res = requests.post(
            f"{base}/robot/send?access_token={bot_key}",
            json={"msgtype": msgtype, msgtype: body},
        )
        return res.json()
  • The add_tools function that registers ding_send_text as an MCP tool via the @mcp.tool decorator, with title '钉钉群机器人-发送文本消息' and Chinese description. It also registers other tools (lark, bark, ntfy, pushplus) in the same function.
    def add_tools(mcp: FastMCP, logger=None):
    
        @mcp.tool(
            title="钉钉群机器人-发送文本消息",
            description="钉钉群机器人发送文本或Markdown消息",
        )
  • Input schema for ding_send_text defined via Pydantic Field annotations: text (required string), title (optional string, default ''), msgtype (string, default 'markdown', only text/markdown), bot_key (string, optional, defaults to DINGTALK_BOT_KEY env var).
    def ding_send_text(
        text: str = Field(description="消息内容"),
        title: str = Field("", description="消息标题"),
        msgtype: str = Field("markdown", description="内容类型,仅支持: text/markdown"),
        bot_key: str = Field("", description="钉钉群机器人access_token,默认从环境变量获取"),
  • Top-level registration: creates the FastMCP server instance and calls other.add_tools(mcp) to register all tools including ding_send_text.
    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)
Behavior2/5

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

No annotations are present, so the description must fully disclose behavioral traits. It only states the tool sends messages; it does not mention authentication (bot_key), error handling, rate limits, idempotency, or whether the operation is destructive. This is insufficient for an agent to understand implications.

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, concise and front-loaded. However, given the low behavioral transparency and missing guidance, a slightly longer description with more context would be justified without sacrificing conciseness.

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?

With no output schema, no annotations, and 4 parameters, the description is too sparse. It fails to explain important aspects like how bot_key defaults from environment variable, the role of title in Markdown messages, or what the response looks like. The tool's complexity warrants a richer description.

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 baseline is 3. The description adds no additional meaning beyond the schema fields; each parameter is already described in the schema. The tool's description does not clarify relationships between parameters (e.g., title and msgtype) or provide context for use.

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?

The description clearly states that the tool sends text or Markdown messages via a DingTalk group robot. It uses a specific verb ('发送') and resource ('钉钉群机器人'), which distinguishes it from sibling tools targeting other platforms (e.g., Bark, Lark, Telegram).

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. With many sibling tools for different messaging platforms, explicit instructions on when to choose DingTalk robot over others are missing.

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