# DingTalk MCP MCP

> DingTalk MCP connects your agent to Alibaba's enterprise communication platform for managing internal operations. Use it to check employee attendance, map complex department hierarchies, send formatted announcements, and run automated approval workflows—all from a single chat window.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** enterprise-messaging, workflow-automation, attendance-tracking, b2b-operations, task-management, notifications

## Description

Managing an office today means jumping between three different systems: the HR database, the team chat app, and the workflow portal. This MCP makes that jump obsolete. It lets your AI agent act as a centralized operations assistant for everything internal. Need to know who reports to whom? Ask it. Want to send a formatted announcement about a policy change? Do it without copy-pasting markdown into a separate app. You can track an employee's entire lifecycle—from checking their initial attendance records to initiating a leave request, and then broadcasting the final approval status to the whole team. The real power comes when you chain this MCP with other services in the Vinkius catalog; for example, triggering a payment record update immediately after tracking a successful purchase order approval. You don't need multiple logins or complex integrations. Just connect once from your preferred AI client and start running core business processes through natural conversation.

## Tools

### create_approval_process
Start a new workflow instance for things like leave requests or purchases by feeding it the required template code and user IDs.

### get_approval_instance
Checks if an existing approval process is pending, approved, rejected, or cancelled, giving you all the reviewer actions taken.

### get_attendance_records
Retrieves timestamps and checkout types for employees to verify attendance patterns across a date range.

### get_department_info
Provides detailed information about any department, helping you understand its role in the company structure.

### get_user_info
Looks up a specific employee's profile details using only their user ID before sending them targeted notifications.

### list_all_departments
Gives you the complete list of top-level departments in the organization, which is needed to start any structural query.

### list_sub_departments
Drills down into a parent department to map out every single team division and sub-group beneath it.

### list_users_by_department
Gathers the list of all users, names, and basic profiles belonging to a specific departmental group.

### send_markdown_message
Sends highly structured reports or detailed alerts using full markdown formatting (like bold text and links) to multiple recipients.

### send_work_notification
Posts a standard message, reminder, or task assignment directly into the recipient's work notification feed for immediate visibility.

## Prompt Examples

**Prompt:** 
```
List all users in department ID 12345.
```

**Response:** 
```
📋 I found 8 users in department 12345: Zhang Wei (Engineering Lead), Li Na (Senior Developer), Wang Fang (Developer), Chen Ming (QA Engineer), Liu Yang (Designer), Zhao Lei (Product Manager), Sun Li (Business Analyst), and Zhou Tao (DevOps). Would you like detailed profiles for any specific user?
```

**Prompt:** 
```
Send a markdown notification to user1,user2 with title 'Sprint Review' and content about tomorrow's meeting at 2pm.
```

**Response:** 
```
✅ Markdown notification sent successfully! Task ID: 987654321. The message with title 'Sprint Review' has been delivered to user1 and user2. The notification includes formatted details about tomorrow's 2pm meeting with agenda items and meeting link.
```

**Prompt:** 
```
Check attendance records for user1,user2 from 2024-01-15 to 2024-01-19.
```

**Response:** 
```
📊 Attendance report (Jan 15-19, 2024): **user1** - Mon: Check-in 08:55, Check-out 18:02 (Normal); Tue: Check-in 09:12 (Late by 12min), Check-out 18:00; Wed-Fri: Normal attendance. **user2** - All days normal with average check-in at 08:50. Both users show good attendance patterns with only one late occurrence.
```

## Capabilities

### Map Organizational Structure
List all departments, sub-departments, and retrieve detailed information about any specific organizational unit.

### Manage Employee Profiles
Search for individual employee details using their user ID or query a list of users within a specified department.

### Track Time and Attendance
Pull check-in/check-out records to monitor who is working, when they arrived, and if any shifts were marked as late or early.

### Initiate Workflows
Start new official processes—like reimbursement requests or vacation time off—and track them until completion.

### Send Rich Communications
Broadcast announcements, formatted alerts, or detailed reports to multiple team members with rich text and links.

## Use Cases

### New Hire Onboarding
An Ops Lead needs to confirm who is on the team. They ask the agent to list all users in the Engineering department, then use `get_user_info` for each person's profile before sending a group welcome notification via `send_work_notification`.

### Expense Report Bottleneck
A manager needs to know why an expense report is stuck. They use the agent to check the approval status using `get_approval_instance`, immediately identifying which reviewer hasn't acted, and then they can send a reminder via `send_markdown_message`.

### Compliance Audit Prep
HR needs an attendance snapshot for last quarter. They run the report using `get_attendance_records`, which pulls all check-in/check-out data, letting them quickly verify compliance without pulling CSVs from a backend system.

### Department Restructure
A leader needs to know if they should merge two teams. They first run `list_all_departments` and then use `list_sub_departments` on both departments to map out their full current hierarchies before making a decision.

## Benefits

- Stop guessing who reports to whom. Use the departmental listing tools to map out the full organizational structure before making any decisions about communication routing.
- Track compliance with `get_attendance_records`. You can verify time sheets and instantly spot patterns of late arrivals or missing check-ins without running manual payroll checks.
- Automate approvals from start to finish. Use `create_approval_process` to kick off a purchase request, then use `get_approval_instance` to track its progress in the chat window until it's finalized.
- Broadcast formatted updates with `send_markdown_message`. Instead of sending plain text emails, you can deliver rich reports that include bold headers and clickable links directly into DingTalk.
- Improve team awareness by using `list_users_by_department` to get a current roster. This ensures any group notification or task assignment goes out to the right people every time.

## How It Works

The bottom line is you get one chat interface that handles HR lookups, communication broadcasts, and complex process tracking without requiring any direct access to the DingTalk app itself.

1. Subscribe to the DingTalk MCP on Vinkius.
2. Provide your required DingTalk App Key and Secret credentials.
3. Start by asking your agent to perform an action, like listing all departments or checking attendance for a specific date range.

## Frequently Asked Questions

**How do I use `list_users_by_department` with this MCP?**
You must provide the department ID number first. This tool then returns a list of user IDs, names, and basic profiles for everyone belonging to that specific department.

**Can I use `get_attendance_records` to find who was late?**
Yes. It pulls the full check-in/check-out history for a date range and specifically flags any records marked as abnormal, like being late or leaving early.

**What's the difference between `send_markdown_message` and `send_work_notification`?**
`Send_markdown_message` is for rich reports and detailed alerts where you need full formatting. `Send_work_notification` is better for simple, immediate reminders or status updates that pop into a user's feed.

**Does the MCP help me map department hierarchies?**
Yes. You can use `list_all_departments` to see top-level units and then use `list_sub_departments` to drill down and understand every nested team structure.

**When I use `get_user_info`, what security measures protect my DingTalk credentials?**
The platform uses a zero-trust proxy. Your keys only pass through in transit and are never stored on disk, so your credentials stay secure no matter how many times you run the tool.

**If I initiate an approval with `create_approval_process`, how do I track its status or find bottlenecks?**
You call `get_approval_instance` using the process ID. This function provides a full audit trail, showing if the request is pending, approved, rejected, and who took action when.

**When running `list_sub_departments`, what should I use as the starting parent department ID?**
You generally start with the top-level department ID, usually '1'. This ensures you map out all foundational divisions before you dive into specific sub-teams or reporting structures.

**If `list_users_by_department` returns a huge list of users, how does it handle pagination?**
The MCP manages large datasets by providing paginated results. The output includes the necessary tokens or cursors you'll need to fetch all remaining user data in subsequent calls without hitting limits.