delete_comment
Permanently delete a specific comment from Kanboard. Must provide comment ID and explicit confirmation. Returns success indicator and comment ID.
Instructions
Permanently delete a Kanboard comment. DESTRUCTIVE — requires explicit confirm: true. Returns { ok: true, comment_id } on success.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comment_id | Yes | Comment id to permanently delete (required). | |
| confirm | Yes | Must be exactly `true` to confirm permanent deletion. |
Implementation Reference
- src/tools/delete-comment.ts:57-85 (handler)The main tool definition for delete_comment. Contains the handler function that validates input via Zod, asserts confirmation, and calls deps.handler.removeComment() to perform the deletion.
export const deleteCommentTool = { name: "delete_comment", description: "Permanently delete a Kanboard comment. DESTRUCTIVE — requires explicit `confirm: true`. " + "Returns { ok: true, comment_id } on success.", inputSchema: DeleteCommentInput, handler: async (raw: unknown, deps: ToolDeps): Promise<DeleteCommentResult> => { const parsed = DeleteCommentInput.safeParse(raw); if (!parsed.success) { throw new ValidationError( "delete_comment", parsed.error.issues.map((i) => i.message).join("; "), parsed.error.issues, ); } const input = parsed.data; assertConfirmed("delete_comment", input.confirm); await deps.handler.removeComment(input.comment_id); return { content: [ { type: "text", text: `Comment ${String(input.comment_id)} deleted permanently.` }, ], structuredContent: { ok: true, comment_id: input.comment_id }, }; }, }; - src/tools/delete-comment.ts:20-31 (schema)Zod input schema for delete_comment. Requires comment_id (positive integer) and confirm (must be literal true).
export const DeleteCommentInput = z .object({ comment_id: z .number() .int() .positive() .describe("Comment id to permanently delete (required)."), confirm: z .literal(true) .describe("Must be exactly `true` to confirm permanent deletion."), }) .strict(); - src/tools/index.ts:215-233 (registration)The registerTools function that mounts all tools (including deleteCommentTool) on an McpServer instance. The tool is registered at index 170 in the allTools array.
export function registerTools(server: McpServer, deps: ToolDeps): void { for (const tool of allTools) { // Cast: each tool handler returns a `{ content, structuredContent }` object // that satisfies `CallToolResult`. We use `unknown` in `ToolDef.handler` to // keep the per-tool return types encapsulated, so we cast here at the // registration boundary where the MCP SDK takes ownership. const cb = ((args: Record<string, unknown>) => tool.handler(args, deps)) as unknown as ToolCallback; server.registerTool( tool.name, { description: tool.description, inputSchema: tool.inputSchema, }, cb, ); } } - src/tools/index.ts:159-197 (registration)allTools array listing deleteCommentTool at index 170. This is the ordered registry used by registerTools.
export const allTools: readonly ToolDef[] = [ addProjectUserTool, attachFileToTaskTool, createColumnTool, createCommentTool, createProjectTool, createSubtaskTool, createSwimlaneTool, createTaskTool, createTasksBatchTool, deleteColumnTool, deleteCommentTool, deleteProjectTool, deleteSubtaskTool, deleteSwimlaneTool, deleteTaskTool, deleteTaskFileTool, getProjectTool, getTaskTool, listCategoriesTool, listColumnsTool, listMyTasksTool, listOverdueTasksTool, listProjectsTool, listSubtasksTool, listSwimlanesTool, listTasksTool, listProjectUsersTool, moveColumnTool, moveSwimlaneTool, moveTaskPositionTool, removeProjectUserTool, updateColumnTool, updateCommentTool, updateProjectTool, updateSubtaskTool, updateSwimlaneTool, updateTaskTool, ] as const; - src/handler/kanboard.ts:1040-1049 (helper)The KanboardHandler.removeComment() method that calls Kanboard's removeComment API via the JSON-RPC client. This is the low-level API invocation delegated to by the tool handler.
/** * Permanently removes a comment. * Kanboard's wire param for this method is `comment_id`. * @throws {KanboardApiError} when Kanboard returns false. */ public async removeComment(commentId: number): Promise<void> { const raw = await this.#apiClient.call("removeComment", { comment_id: commentId }); this.#logger.debug({ method: "removeComment" }, "removeComment OK"); decodeMutation("removeComment", raw); }