URGENT_FIX_SUMMARY.md•3.43 kB
# 🚨 URGENT FIX: ClickUp Task Creation/Update HTML Issue
## Issue Summary
The ClickUp MCP server was incorrectly converting markdown content to HTML and sending it via the `description` field, causing HTML formatting to appear in ClickUp task descriptions instead of proper markdown rendering.
## Root Cause
- Markdown content was being converted to HTML using `markdownToHtml()`
- HTML was sent via `description` field instead of `markdown_content` field
- ClickUp API expects raw markdown in `markdown_content` field for proper rendering
## ✅ FIXES APPLIED
### 1. Fixed Content Processing Logic
**File:** `src/utils/markdown.ts`
- Modified `prepareContentForClickUp()` to use `markdown_content` field for markdown
- Markdown now sent as raw markdown, not converted to HTML
- HTML and plain text still use `description` field correctly
### 2. Updated Task Interfaces
**File:** `src/clickup-client/tasks.ts`
- Added `markdown_content` field to `CreateTaskParams` and `UpdateTaskParams`
- Updated `createTask()` and `updateTask()` methods to handle new field
- Added logic to remove `description` when using `markdown_content`
### 3. Enhanced Tool Definitions
**File:** `src/tools/task-tools.ts`
- Added `markdown_content` parameter to both create and update tools
- Added preference logic: `markdown_content` takes priority over `description`
- Improved parameter descriptions for clarity
## 🎯 BEHAVIOR CHANGES
| Content Type | Before | After |
|--------------|--------|-------|
| Markdown | `description: "<h1>HTML</h1>"` | `markdown_content: "# Markdown"` |
| HTML | `description: "<h1>HTML</h1>"` | `description: "<h1>HTML</h1>"` ✅ |
| Plain Text | `description: "text"` | `description: "text"` ✅ |
## ✅ VERIFICATION COMPLETED
- ✅ Build successful with no compilation errors
- ✅ Markdown detection working correctly
- ✅ Field selection logic verified
- ✅ Edge cases handled (empty, null, undefined)
- ✅ Backward compatibility maintained
## 🔧 TESTING TOOLS AVAILABLE
1. **Test Tool Created:** `clickup_test_task_update` - for verifying update functionality
2. **Documentation:** `TASK_CREATION_FIX.md` - detailed technical documentation
## 📋 IMMEDIATE NEXT STEPS
1. **Test the fix** with actual ClickUp API:
```bash
# Use the MCP server to create a task with markdown
clickup_create_task({
list_id: "your_list_id",
name: "Test Markdown Task",
description: "# Header\n\nThis is **bold** text"
})
```
2. **Verify task update works**:
```bash
# Test updating the problematic task
clickup_update_task({
task_id: "868fa998b",
description: "# Fixed Description\n\nNow with **proper** markdown"
})
```
3. **Check existing tasks** that have HTML formatting issues and update them
## 🚀 EXPECTED RESULTS
- ✅ New tasks with markdown will render properly in ClickUp
- ✅ Task updates will work correctly
- ✅ No more HTML tags appearing in task descriptions
- ✅ Existing HTML/plain text tasks continue to work
## 📁 FILES MODIFIED
1. `src/utils/markdown.ts` - Core content processing logic
2. `src/clickup-client/tasks.ts` - Task client interfaces and methods
3. `src/tools/task-tools.ts` - MCP tool definitions
4. `src/tools/test-task-update.ts` - New test tool (optional)
---
**Status:** ✅ **READY FOR TESTING**
**Build:** ✅ **SUCCESSFUL**
**Risk:** 🟢 **LOW** (Backward compatible, only fixes broken behavior)