create_comment
Add comments to cards to facilitate project discussions and track conversations within Codecks project management workflows.
Instructions
Start a new comment thread on a card.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| card_id | Yes | Full 36-char UUID | |
| message | Yes | Comment message |
Implementation Reference
- src/tools/comments.ts:18-48 (registration)Tool registration for 'create_comment' with metadata, zod input schema, and handler function that validates UUID and message, calls client.createComment, and formats the response.export function registerCommentTools(server: McpServer, client: CodecksClient): void { server.registerTool( "create_comment", { title: "Create Comment", description: "Start a new comment thread on a card.", inputSchema: z.object({ card_id: z.string().describe("Full 36-char UUID"), message: z.string().describe("Comment message"), }), }, async (args) => { try { validateUuid(args.card_id); const message = validateInput(args.message, "message"); const result = await client.createComment(args.card_id, message); return { content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }], }; } catch (err) { return { content: [ { type: "text", text: JSON.stringify(finalizeToolResult(handleError(err))), }, ], }; } }, );
- src/tools/comments.ts:24-27 (schema)Input validation schema using zod for card_id (36-char UUID string) and message (string).inputSchema: z.object({ card_id: z.string().describe("Full 36-char UUID"), message: z.string().describe("Comment message"), }),
- src/tools/comments.ts:29-46 (handler)Handler function that validates the card_id UUID and message input, calls client.createComment, and returns a formatted MCP tool response with error handling.async (args) => { try { validateUuid(args.card_id); const message = validateInput(args.message, "message"); const result = await client.createComment(args.card_id, message); return { content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }], }; } catch (err) { return { content: [ { type: "text", text: JSON.stringify(finalizeToolResult(handleError(err))), }, ], }; }
- src/client.ts:601-607 (handler)Core implementation of createComment method that dispatches 'card-conversations/create' API call with cardId and message, returning success response with card_id and result.async createComment(cardId: string, message: string): Promise<Record<string, unknown>> { const result = await dispatch("card-conversations/create", { cardId, message, }); return { ok: true, card_id: cardId, result }; }