From 7346be4a4ad34e55384ffb9025ca3ec11bc495fa Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Fri, 27 Feb 2026 08:54:33 +0100 Subject: [PATCH 1/5] feat: add everyrow_list_session_tasks MCP tool Calls GET /api/v0/sessions/{id}/tasks to list task IDs, statuses, and types for a session. Used by the agent to look up tasks for displaying previous results in the viz pane. Co-Authored-By: Claude Opus 4.6 --- everyrow-mcp/src/everyrow_mcp/models.py | 8 +++++ everyrow-mcp/src/everyrow_mcp/tools.py | 47 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/everyrow-mcp/src/everyrow_mcp/models.py b/everyrow-mcp/src/everyrow_mcp/models.py index 2a5ebc98..323fe856 100644 --- a/everyrow-mcp/src/everyrow_mcp/models.py +++ b/everyrow-mcp/src/everyrow_mcp/models.py @@ -741,3 +741,11 @@ class ListSessionsInput(BaseModel): limit: int = Field( 25, ge=1, le=1000, description="Max sessions per page (default 25, max 1000)" ) + + +class ListSessionTasksInput(BaseModel): + """Input for listing tasks in a session.""" + + model_config = ConfigDict(extra="forbid") + + session_id: str = Field(description="The session ID to list tasks for") diff --git a/everyrow-mcp/src/everyrow_mcp/tools.py b/everyrow-mcp/src/everyrow_mcp/tools.py index 09889b60..0a1803bc 100644 --- a/everyrow-mcp/src/everyrow_mcp/tools.py +++ b/everyrow-mcp/src/everyrow_mcp/tools.py @@ -44,6 +44,7 @@ ForecastInput, HttpResultsInput, ListSessionsInput, + ListSessionTasksInput, MergeInput, ProgressInput, RankInput, @@ -1273,6 +1274,52 @@ async def everyrow_balance(ctx: EveryRowContext) -> list[TextContent]: ] +@mcp.tool( + name="everyrow_list_session_tasks", + structured_output=False, + annotations=ToolAnnotations( + title="List Tasks in a Session", + readOnlyHint=True, + destructiveHint=False, + idempotentHint=True, + openWorldHint=False, + ), +) +async def everyrow_list_session_tasks( + params: ListSessionTasksInput, ctx: EveryRowContext +) -> list[TextContent]: + """List all tasks in a session with their IDs, statuses, and types. + + Use this to find task IDs for a session so you can display previous results + with mcp__display__show_task(task_id, label). + """ + client = _get_client(ctx) + + try: + response = await client.get_async_httpx_client().request( + method="get", + url=f"/sessions/{params.session_id}/tasks", + ) + response.raise_for_status() + data = response.json() + except Exception as e: + return [TextContent(type="text", text=f"Error listing session tasks: {e!r}")] + + tasks = data.get("tasks", []) + if not tasks: + return [TextContent(type="text", text=f"No tasks found in session {params.session_id}.")] + + lines = [f"Found {len(tasks)} task(s) in session {params.session_id}:\n"] + for t in tasks: + artifact = f" | artifact: {t['artifact_id']}" if t.get("artifact_id") else "" + lines.append( + f"- **{t['task_type']}** (task_id: {t['task_id']})\n" + f" Status: {t['status']} | Created: {t['created_at']}{artifact}" + ) + + return [TextContent(type="text", text="\n".join(lines))] + + @mcp.tool( name="everyrow_cancel", structured_output=False, From 4d9427b4998bfe2af0378e8e521445b1bb50c02f Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Fri, 27 Feb 2026 18:25:56 +0100 Subject: [PATCH 2/5] style: fix ruff formatting in list_session_tasks Co-Authored-By: Claude Opus 4.6 --- everyrow-mcp/src/everyrow_mcp/tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/everyrow-mcp/src/everyrow_mcp/tools.py b/everyrow-mcp/src/everyrow_mcp/tools.py index 0a1803bc..4d6710ee 100644 --- a/everyrow-mcp/src/everyrow_mcp/tools.py +++ b/everyrow-mcp/src/everyrow_mcp/tools.py @@ -1307,7 +1307,11 @@ async def everyrow_list_session_tasks( tasks = data.get("tasks", []) if not tasks: - return [TextContent(type="text", text=f"No tasks found in session {params.session_id}.")] + return [ + TextContent( + type="text", text=f"No tasks found in session {params.session_id}." + ) + ] lines = [f"Found {len(tasks)} task(s) in session {params.session_id}:\n"] for t in tasks: From 7c79c1cceed41983830c6f008d825399474ec60f Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Fri, 27 Feb 2026 18:30:41 +0100 Subject: [PATCH 3/5] fix: add everyrow_list_session_tasks to manifest and test expected tools Co-Authored-By: Claude Opus 4.6 --- everyrow-mcp/manifest.json | 4 ++++ everyrow-mcp/tests/test_mcp_e2e.py | 1 + 2 files changed, 5 insertions(+) diff --git a/everyrow-mcp/manifest.json b/everyrow-mcp/manifest.json index 2949ddfd..938b2072 100644 --- a/everyrow-mcp/manifest.json +++ b/everyrow-mcp/manifest.json @@ -73,6 +73,10 @@ "name": "everyrow_list_sessions", "description": "List everyrow sessions owned by the authenticated user (paginated)." }, + { + "name": "everyrow_list_session_tasks", + "description": "List all tasks in a session with their IDs, statuses, and types." + }, { "name": "everyrow_cancel", "description": "Cancel a running everyrow task. Use when the user wants to stop a task that is currently processing." diff --git a/everyrow-mcp/tests/test_mcp_e2e.py b/everyrow-mcp/tests/test_mcp_e2e.py index 660ee564..bace0b76 100644 --- a/everyrow-mcp/tests/test_mcp_e2e.py +++ b/everyrow-mcp/tests/test_mcp_e2e.py @@ -179,6 +179,7 @@ async def test_list_tools(self, _http_state): "everyrow_classify", "everyrow_dedupe", "everyrow_forecast", + "everyrow_list_session_tasks", "everyrow_list_sessions", "everyrow_merge", "everyrow_progress", From 2d5b208f5ec81ac962464d43af8753b31a23ebf7 Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Fri, 27 Feb 2026 23:05:26 +0100 Subject: [PATCH 4/5] fix: rename artifact to output_artifact for clarity Co-Authored-By: Claude Opus 4.6 --- everyrow-mcp/src/everyrow_mcp/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/everyrow-mcp/src/everyrow_mcp/tools.py b/everyrow-mcp/src/everyrow_mcp/tools.py index 4d6710ee..fa32b800 100644 --- a/everyrow-mcp/src/everyrow_mcp/tools.py +++ b/everyrow-mcp/src/everyrow_mcp/tools.py @@ -1315,7 +1315,7 @@ async def everyrow_list_session_tasks( lines = [f"Found {len(tasks)} task(s) in session {params.session_id}:\n"] for t in tasks: - artifact = f" | artifact: {t['artifact_id']}" if t.get("artifact_id") else "" + artifact = f" | output_artifact: {t['artifact_id']}" if t.get("artifact_id") else "" lines.append( f"- **{t['task_type']}** (task_id: {t['task_id']})\n" f" Status: {t['status']} | Created: {t['created_at']}{artifact}" From 4aaae3a31fbdcee7d37711985e444b4e5b1e8a1a Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Fri, 27 Feb 2026 23:22:20 +0100 Subject: [PATCH 5/5] style: fix ruff formatting for output_artifact line Co-Authored-By: Claude Opus 4.6 --- everyrow-mcp/src/everyrow_mcp/tools.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/everyrow-mcp/src/everyrow_mcp/tools.py b/everyrow-mcp/src/everyrow_mcp/tools.py index fa32b800..92ef4e48 100644 --- a/everyrow-mcp/src/everyrow_mcp/tools.py +++ b/everyrow-mcp/src/everyrow_mcp/tools.py @@ -1315,7 +1315,9 @@ async def everyrow_list_session_tasks( lines = [f"Found {len(tasks)} task(s) in session {params.session_id}:\n"] for t in tasks: - artifact = f" | output_artifact: {t['artifact_id']}" if t.get("artifact_id") else "" + artifact = ( + f" | output_artifact: {t['artifact_id']}" if t.get("artifact_id") else "" + ) lines.append( f"- **{t['task_type']}** (task_id: {t['task_id']})\n" f" Status: {t['status']} | Created: {t['created_at']}{artifact}"