Skip to main content
Glama
Shawyeok

mcp-dingding-bot

send_text_message

Send plain text messages to DingTalk group chats with optional @mentions for specific users or all members.

Instructions

Send a plain text message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe text content to send
atMobilesNoThe mobile numbers of users to @mention (ping) individually in the group chat
atAllNoWhether to @all the users in the group

Implementation Reference

  • Handler function for 'send_text_message' tool that invokes DingtalkBot.sendText and formats MCP response
      async ({ text, atMobiles, atAll }) => {
        const response = await dingtalkBot.sendText(text, atMobiles, atAll);
        if (response.errcode !== 0) {
          return {
            content: [{ type: "text", text: `Failed to send message, code: ${response.errcode}, message: ${response.errmsg}` }],
          };
        }
        return {
          content: [{ type: "text", text: "Message sent successfully" }],
        };
      }
    );
  • Input schema (zod) for send_text_message tool
    {
      text: z.string().describe("The text content to send"),
      atMobiles: z.array(z.string()).optional().describe("The mobile numbers of users to @mention (ping) individually in the group chat"),
      atAll: z.boolean().optional().describe("Whether to @all the users in the group"),
    },
  • src/index.ts:22-41 (registration)
    Registration of send_text_message tool using server.tool() including schema and handler
    server.tool(
      'send_text_message',
      'Send a plain text message',
      {
        text: z.string().describe("The text content to send"),
        atMobiles: z.array(z.string()).optional().describe("The mobile numbers of users to @mention (ping) individually in the group chat"),
        atAll: z.boolean().optional().describe("Whether to @all the users in the group"),
      },
      async ({ text, atMobiles, atAll }) => {
        const response = await dingtalkBot.sendText(text, atMobiles, atAll);
        if (response.errcode !== 0) {
          return {
            content: [{ type: "text", text: `Failed to send message, code: ${response.errcode}, message: ${response.errmsg}` }],
          };
        }
        return {
          content: [{ type: "text", text: "Message sent successfully" }],
        };
      }
    );
  • DingtalkBot.sendText method implementing the core logic for sending text messages to DingTalk robot API, called by the tool handler
    async sendText(
      content: string,
      atMobiles?: string[],
      atAll: boolean = false
    ): Promise<MessageResponse> {
      const data: TextMessage = {
        msgtype: 'text',
        text: {
          content,
        },
        at: {
          atMobiles: atMobiles || [],
          isAtAll: atAll,
        },
      };
    
      const response = await fetch(this.getSignedUrl(), {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        body: JSON.stringify(data),
      });
      return response.json() as Promise<MessageResponse>;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action. It fails to mention critical aspects like required permissions, rate limits, side effects (e.g., message delivery confirmation), or error handling, which are essential for a messaging tool.

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 with zero wasted words. It is appropriately sized and front-loaded, clearly stating the core purpose without unnecessary elaboration.

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 a messaging tool with no annotations or output schema, the description is insufficient. It lacks details on behavioral traits, response format, error conditions, and sibling differentiation, leaving significant gaps for agent understanding.

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 fully documents all parameters. The description adds no additional meaning beyond implying text content is sent, which the schema already covers. This meets the baseline for high schema coverage.

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') and resource ('a plain text message'), making the purpose immediately understandable. However, it doesn't differentiate from its sibling 'send_markdown_message' beyond the format type, missing explicit comparison that would warrant a 5.

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 its sibling 'send_markdown_message' or any alternatives. The description lacks context about appropriate use cases, prerequisites, or exclusions, leaving the agent without usage direction.

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/Shawyeok/mcp-dingding-bot'

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