feat: add everyrow_list_session_tasks MCP tool#243
Conversation
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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d045d19 to
4d9427b
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| f"- **{t['task_type']}** (task_id: {t['task_id']})\n" | ||
| f" Status: {t['status']} | Created: {t['created_at']}{artifact}" |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
CLAUDE: Not a real issue. These fields (task_id, task_type, status, created_at) are required columns in our tasks table — the API endpoint that serves this data is defined by us in the engine and will always include them. Adding .get() fallbacks for schema-guaranteed fields is unnecessary defensive programming.
The artifact_id uses .get() because it's genuinely nullable — tasks don't have an artifact until processing completes. That's a semantic distinction, not an inconsistency.
👎
|
|
||
| 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 "" |
There was a problem hiding this comment.
nit: is it implied this is the output artifact id?
There was a problem hiding this comment.
Good catch — renamed to output_artifact in 2d5b208.
| ) | ||
| ] | ||
|
|
||
| lines = [f"Found {len(tasks)} task(s) in session {params.session_id}:\n"] |
There was a problem hiding this comment.
How much work would it be to have the input artifact id(s) as well?
There was a problem hiding this comment.
Very doable — the input_artifacts and context_artifacts uuid[] columns already exist on the tasks table, and get_tasks_for_session() already fetches them. Just need to add two optional fields to SessionTaskItem and pass them through in the handler (~5 lines in the engine + MCP tool update). Will do as a follow-up.
There was a problem hiding this comment.
(That was Claude)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
everyrow_list_session_tasksMCP tool that callsGET /api/v0/sessions/{id}/tasksto list task IDs, statuses, and types for a sessionListSessionTasksInputmodel withsession_idfieldmcp__display__show_taskDependencies
GET /api/v0/sessions/{id}/tasks)Test plan
list_tools()outputlist_session_tasks→ gets task IDs → callsshow_task→ viz panel displays results🤖 Generated with Claude Code