Skip to main content
Glama
sfyyy

Claude Code DingTalk MCP Server

by sfyyy

dingtalk_send_markdown

Send formatted markdown messages to DingTalk groups for task alerts and notifications from Claude Code.

Instructions

Send a markdown message to DingTalk group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesMessage title
textYesMarkdown formatted text content
atAllNoWhether to @all members

Implementation Reference

  • The primary handler for the 'dingtalk_send_markdown' tool. It checks if the DingTalk client is configured, appends the Git username to the message text, calls the DingTalkClient's sendMarkdown method, and returns a success or failure response.
    private async handleSendMarkdown(args: { title: string; text: string; atAll?: boolean }) {
      if (!this.dingTalkClient) {
        throw new Error('DingTalk client not configured. Use dingtalk_configure first or set environment variables (DINGTALK_WEBHOOK, DINGTALK_SECRET).');
      }
    
      const gitUsername = this.getGitUsername();
      const textWithUser = `${args.text}\n\n---\nšŸ‘¤ **å‘é€č€…:** ${gitUsername}`;
    
      const success = await this.dingTalkClient.sendMarkdown(args.title, textWithUser, args.atAll);
      return {
        content: [
          {
            type: 'text',
            text: success 
              ? 'āœ… Markdown message sent successfully' 
              : 'āŒ Failed to send markdown message',
          },
        ],
      };
  • Input schema definition for the 'dingtalk_send_markdown' tool, specifying required title and text fields, and optional atAll boolean.
    {
      name: 'dingtalk_send_markdown',
      description: 'Send a markdown message to DingTalk group',
      inputSchema: {
        type: 'object',
        properties: {
          title: {
            type: 'string',
            description: 'Message title',
          },
          text: {
            type: 'string',
            description: 'Markdown formatted text content',
          },
          atAll: {
            type: 'boolean',
            description: 'Whether to @all members',
            default: false,
          },
        },
        required: ['title', 'text'],
      },
    },
  • src/index.ts:212-213 (registration)
    Tool dispatch registration in the CallToolRequestSchema handler's switch statement, routing calls to the handleSendMarkdown method.
    case 'dingtalk_send_markdown':
      return await this.handleSendMarkdown(args as unknown as { title: string; text: string; atAll?: boolean });
  • Helper method in DingTalkClient that formats and sends the markdown message to the DingTalk webhook using the generic sendMessage method.
    async sendMarkdown(title: string, text: string, atAll = false): Promise<boolean> {
      return this.sendMessage({
        msgtype: 'markdown',
        markdown: { title, text },
        at: { isAtAll: atAll }
      });
    }
  • Example usage of the tool in session-notifier.ts, demonstrating how it's called via MCP request.
    name: 'dingtalk_send_markdown',
    arguments: {
      title,
      text: content,
      atAll: false
    }
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. It states the action ('send') but doesn't cover critical aspects like whether this requires specific permissions, rate limits, error handling, or what happens on success/failure. For a messaging tool with zero annotation coverage, this leaves significant gaps in understanding its operational behavior.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy to parse quickly while conveying the essential action and target.

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 and no output schema, the description is insufficient. It doesn't explain what the tool returns, error conditions, dependencies on other tools like 'dingtalk_configure', or how it fits into the broader DingTalk ecosystem. This leaves the agent with incomplete context for reliable use.

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 description adds no parameter-specific information beyond what's already in the schema, which has 100% coverage with clear descriptions for 'title', 'text', and 'atAll'. Since the schema fully documents the parameters, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract from the schema's completeness.

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 ('markdown message to DingTalk group'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'dingtalk_send_text' or 'dingtalk_send_link' which also send messages, leaving room for ambiguity about when to choose markdown format over text or link formats.

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 like 'dingtalk_send_text' or 'dingtalk_send_link'. It lacks context about prerequisites (e.g., authentication setup via 'dingtalk_configure'), target audience, or scenarios where markdown is preferred over plain text or links.

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/sfyyy/claude-code-dingtalk-mcp'

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