From 15b72c6739026c7e0a679a9e1f5ebd7829f23b4b Mon Sep 17 00:00:00 2001 From: tegwick Date: Wed, 18 Mar 2026 23:01:22 +0100 Subject: [PATCH] =?UTF-8?q?feat(mcp):=20add=20list=5Ftasks(workstream=5Fid?= =?UTF-8?q?)=20tool=20=E2=80=94=20resolves=20FR=207074fd47?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Agents had no way to look up task UUIDs by workstream; they were stuck unable to call update_task_status without already knowing the UUID. list_tasks() wraps GET /tasks with workstream_id filter, returning [{id, title, status, priority}] for all matching tasks. FR raised by kaizen-agentic worker on COULOMBCORE while syncing KAIZEN-WP-0002 task IDs. Marked merged in contributions. Co-Authored-By: Claude Sonnet 4.6 --- mcp_server/TOOLS.md | 1 + mcp_server/server.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/mcp_server/TOOLS.md b/mcp_server/TOOLS.md index 18f9ae4..be74044 100644 --- a/mcp_server/TOOLS.md +++ b/mcp_server/TOOLS.md @@ -27,6 +27,7 @@ Do not use them as a substitute for formal work definition inside the domain rep | `get_domain_summary(domain_slug)` | `domain_slug`: e.g. `"railiance"` | **Domain session start.** Scoped snapshot: active workstreams, blocking decisions, last 5 events, repo SBOM status — ~10% of get_state_summary() token cost. | | `get_state_summary()` | — | **Cross-domain work / custodian sessions.** Full snapshot: totals, all blocking decisions, all blocked tasks, all open workstreams, last 20 events. Large (~10k tokens). | | `get_topic(slug)` | `slug`: e.g. `"markitect"` | Deep-dive on one topic + its workstreams + recent events. | +| `list_tasks(workstream_id, status?)` | `workstream_id`: UUID (required); `status?`: todo/in_progress/blocked/done/cancelled | List all tasks in a workstream. Use this to look up task UUIDs before calling `update_task_status`, or to verify which workplan tasks are already synced to the DB. | | `list_blocked_tasks(workstream_id?)` | optional filter | Surface all impediments, optionally scoped to one workstream. | | `list_pending_decisions(topic_id?)` | optional filter | Decisions holding up work, sorted by deadline. | | `get_recent_progress(limit, since?)` | `limit` default 20; `since` ISO datetime | Reconstruct recent session history. | diff --git a/mcp_server/server.py b/mcp_server/server.py index 2fec2e0..37fd33a 100644 --- a/mcp_server/server.py +++ b/mcp_server/server.py @@ -273,6 +273,21 @@ def get_topic(slug: str) -> str: return json.dumps({"topic": topic_detail, "recent_progress": recent}, indent=2) +@mcp.tool() +def list_tasks(workstream_id: str, status: str | None = None) -> str: + """List all tasks in a workstream, optionally filtered by status. + + Args: + workstream_id: UUID of the workstream (required). + status: Optional filter — todo | in_progress | blocked | done | cancelled. + + Returns [{id, title, status, priority, assignee, due_date, needs_human}] for every + matching task. Use this to look up task UUIDs before calling update_task_status, + or to check which tasks from a workplan file are already synced to the DB. + """ + return json.dumps(_get("/tasks", {"workstream_id": workstream_id, "status": status}), indent=2) + + @mcp.tool() def list_blocked_tasks(workstream_id: str | None = None) -> str: """List all tasks with status=blocked, optionally filtered by workstream_id."""