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."""