create-task-comment
Add comments to Dooray tasks to provide progress updates, respond to discussions, log information, or attach files, keeping task discussions organized and accessible.
Instructions
Add a comment (댓글) to an existing Dooray task.
This tool creates a comment on a task, separate from editing the task body itself. Use this for:
Adding progress updates or status notes
Responding to questions or discussions
Logging information related to the task
Attaching files with context
When to Use:
create-task-comment: For adding discussion, updates, or notes (댓글)
update-task: For modifying the task description, title, or metadata
URL Pattern Recognition: When given a Dooray task URL like "https://nhnent.dooray.com/task/PROJECT_ID/TASK_ID":
Extract the first numeric ID after "/task/" as projectId
Extract the second numeric ID as taskId
File Attachments:
To attach files, first upload them using the file upload API
Then provide the returned file IDs in the attachFileIds parameter
See: https://helpdesk.dooray.com/share/pages/9wWo-xwiR66BO5LGshgVTg/2939987647631384419
Content Format:
Use "text/x-markdown" for markdown formatting (recommended)
Use "text/html" for rich HTML content
Body format: {"mimeType": "text/x-markdown", "content": "..."}
Examples:
Simple comment: { "projectId": "123456", "taskId": "789012", "body": {"mimeType": "text/x-markdown", "content": "Progress update: Completed initial implementation"} }
With markdown: { "projectId": "123456", "taskId": "789012", "body": { "mimeType": "text/x-markdown", "content": "## Test Results\n\n- ✅ All unit tests passing\n- ✅ Integration tests passed\n- ⏳ Performance testing in progress" } }
With file attachments: { "projectId": "123456", "taskId": "789012", "body": {"mimeType": "text/x-markdown", "content": "See attached screenshots"}, "attachFileIds": ["file123", "file456"] }
Returns: Created comment with ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID where the task belongs | |
| taskId | Yes | Task ID to add comment to | |
| body | Yes | Comment content with format | |
| attachFileIds | No | Array of file IDs to attach (optional). Files must be uploaded first using the file upload API. |
Implementation Reference
- The main handler function that executes the tool logic: calls the projects API to create a task comment, returns JSON result or formatted error response.export async function createTaskCommentHandler(args: CreateTaskCommentInput) { try { const result = await projectsApi.createTaskComment({ projectId: args.projectId, taskId: args.taskId, body: args.body, attachFileIds: args.attachFileIds, }); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error: ${formatError(error)}`, }, ], isError: true, }; } }
- Zod input schemas (bodySchema and createTaskCommentSchema) for validating tool parameters.const bodySchema = z.object({ mimeType: z.enum(['text/x-markdown', 'text/html']), content: z.string(), }); export const createTaskCommentSchema = z.object({ projectId: z.string().describe('Project ID where the task belongs'), taskId: z.string().describe('Task ID to add comment to'), body: bodySchema.describe('Comment content'), attachFileIds: z.array(z.string()).optional().describe('Array of file IDs to attach (optional)'), }); export type CreateTaskCommentInput = z.infer<typeof createTaskCommentSchema>;
- src/index.ts:54-54 (registration)Registers the 'create-task-comment' tool by mapping its name to the handler and schema in the MCP server's toolRegistry.'create-task-comment': { handler: createTaskCommentHandler, schema: createTaskCommentSchema },
- src/api/projects.ts:159-179 (helper)Supporting API function that makes the actual HTTP POST request to Dooray's endpoint for creating task comments (/projects/{projectId}/posts/{taskId}/logs).export async function createTaskComment( params: CreateTaskCommentParams ): Promise<CreateTaskCommentResponse> { const client = getClient(); const requestBody: Record<string, unknown> = { body: { content: params.body.content, mimeType: params.body.mimeType, }, }; if (params.attachFileIds && params.attachFileIds.length > 0) { requestBody.attachFileIds = params.attachFileIds; } return client.post<CreateTaskCommentResponse>( `${PROJECTS_BASE}/projects/${params.projectId}/posts/${params.taskId}/logs`, requestBody ); }
- src/types/dooray-api.ts:207-220 (schema)TypeScript interface definitions for CreateTaskCommentParams and CreateTaskCommentResponse used by the API layer.export interface CreateTaskCommentParams { projectId: string; taskId: string; body: { content: string; mimeType: 'text/x-markdown' | 'text/html'; }; attachFileIds?: string[]; } export interface CreateTaskCommentResponse { id: string; }