chore(worker): external MCP tools return explicit results instead of empty responses

set_task_config/set_list_config now echo which fields were set vs cleared, get_list_config/get_task_config return an explicit found=false instead of null, and delete_list/run_task_now/reset_failed_task/remove_task_attachment return a confirmation record — matching the found/ok convention already used by batch_get_tasks and get_task_log.
This commit is contained in:
mika kuns
2026-08-05 10:58:28 +02:00
parent 334cf1e1d2
commit c871f35513
11 changed files with 156 additions and 39 deletions
+4 -2
View File
@@ -7,6 +7,7 @@ using ModelContextProtocol.Server;
namespace ClaudeDo.Worker.External;
public sealed record ListSummaryDto(string Id, string Name, string? WorkingDir, string DefaultCommitType);
public sealed record DeleteListResult(bool Deleted, string Id);
[McpServerToolType]
public sealed class ListMcpTools
@@ -61,13 +62,14 @@ public sealed class ListMcpTools
return ToDto(entity);
}
[McpServerTool, Description("Delete a list and its tasks. Irreversible.")]
public async Task DeleteList(string listId, CancellationToken cancellationToken)
[McpServerTool, Description("Delete a list and its tasks. Irreversible. Returns { deleted: true, id } on success.")]
public async Task<DeleteListResult> DeleteList(string listId, CancellationToken cancellationToken)
{
_ = await _lists.GetByIdAsync(listId, cancellationToken)
?? throw new InvalidOperationException($"List {listId} not found.");
await _lists.DeleteAsync(listId, cancellationToken);
await _broadcaster.ListUpdated(listId);
return new DeleteListResult(true, listId);
}
private static ListSummaryDto ToDto(ListEntity l) =>