delete_task_file
Permanently delete a file attachment from a Kanboard task. Requires explicit confirmation to avoid accidental removal.
Instructions
Permanently delete a file attachment from a Kanboard task. DESTRUCTIVE — requires explicit confirm: true. Returns { ok: true, file_id } on success.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes | File id to permanently delete (required). | |
| confirm | Yes | Must be exactly `true` to confirm permanent deletion. |
Implementation Reference
- src/handler/kanboard.ts:1051-1060 (handler)KanboardHandler.removeTaskFile — calls Kanboard's removeTaskFile JSON-RPC method with file_id. This is the underlying API call executed by the tool handler.
/** * Permanently removes a task attachment (file). * Kanboard's wire param for this method is `file_id`. * @throws {KanboardApiError} when Kanboard returns false. */ public async removeTaskFile(fileId: number): Promise<void> { const raw = await this.#apiClient.call("removeTaskFile", { file_id: fileId }); this.#logger.debug({ method: "removeTaskFile" }, "removeTaskFile OK"); decodeMutation("removeTaskFile", raw); } - src/shared/confirm.ts:28-38 (helper)assertConfirmed helper used by the tool handler to enforce confirm: true before performing the destructive delete.
export function assertConfirmed(toolName: string, confirm: boolean): void { // Strict identity check via Object.is rather than `!== true`: // - keeps the lint rule happy (no boolean-literal compare) // - still rejects ANY non-`true` value, including 1, "true", undefined. if (!Object.is(confirm, true)) { throw new ValidationError( toolName, `${toolName}: this is a destructive operation — pass confirm: true to proceed.`, ); } }