add_comment
Add comments or replies to tasks on FluentBoards project boards to facilitate team communication and task clarification.
Instructions
Add a comment to a task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| board_id | Yes | Board ID | |
| task_id | Yes | Task ID | |
| comment | Yes | Comment text | |
| comment_type | No | Comment type - 'comment' for new comments, 'reply' for replies | comment |
| parent_id | No | Parent comment ID (required for replies) | |
| notify_users | No | User IDs to notify |
Implementation Reference
- src/tools/comments.ts:30-58 (handler)Handler function that constructs the comment data from input arguments, conditionally adds parent_id and notify_users, makes a POST request to the API to add the comment to the specified task, and returns the formatted response.async (args) => { const { board_id, task_id, comment, comment_type, parent_id, notify_users, } = args; const commentData: any = { comment: comment, comment_type: comment_type, }; if (parent_id) { commentData.parent_id = parent_id; } if (notify_users && notify_users.length > 0) { commentData.notify_users = notify_users; } const response = await api.post( `/projects/${board_id}/tasks/${task_id}/comments`, commentData ); return formatResponse(response.data); }
- src/tools/comments.ts:7-60 (registration)Registers the 'add_comment' tool on the MCP server, including description, input schema using Zod, and the handler function.export function registerCommentTools(server: McpServer) { // Add a comment to a task server.tool( "add_comment", "Add a comment to a task", { board_id: z.number().int().positive().describe("Board ID"), task_id: z.number().int().positive().describe("Task ID"), comment: z.string().min(1).describe("Comment text"), comment_type: CommentTypeSchema.default("comment").describe( "Comment type - 'comment' for new comments, 'reply' for replies" ), parent_id: z .number() .int() .positive() .optional() .describe("Parent comment ID (required for replies)"), notify_users: z .array(z.number().int().positive()) .optional() .describe("User IDs to notify"), }, async (args) => { const { board_id, task_id, comment, comment_type, parent_id, notify_users, } = args; const commentData: any = { comment: comment, comment_type: comment_type, }; if (parent_id) { commentData.parent_id = parent_id; } if (notify_users && notify_users.length > 0) { commentData.notify_users = notify_users; } const response = await api.post( `/projects/${board_id}/tasks/${task_id}/comments`, commentData ); return formatResponse(response.data); } ); }
- src/types/index.ts:37-44 (schema)Zod schema defining the input structure for adding a comment, matching the tool's parameters exactly.export const AddCommentSchema = z.object({ board_id: z.number().int().positive(), task_id: z.number().int().positive(), comment: z.string().min(1), comment_type: CommentTypeSchema.default("comment"), parent_id: z.number().int().positive().optional(), notify_users: z.array(z.number().int().positive()).optional(), });
- src/index.ts:24-24 (registration)Top-level registration call that invokes registerCommentTools to add the add_comment tool to the MCP server.registerCommentTools(server);
- src/types/index.ts:5-5 (schema)Helper schema for comment_type used within the add_comment tool's input schema.export const CommentTypeSchema = z.enum(["comment", "reply"]);