list_tasks
Retrieve and filter tasks by project, initiative, status, assignee, or search criteria to manage project workflows effectively.
Instructions
List tasks with optional filtering by project, initiative, status, or assignee
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Filter tasks by project ID | |
| initiative_id | No | Filter tasks by initiative ID | |
| status | No | Filter tasks by status | |
| assignee_id | No | Filter tasks by assignee | |
| search | No | Search tasks by title or description | |
| limit | No | Maximum number of tasks to return |
Implementation Reference
- src/tools/tasks.ts:97-118 (handler)The main handler function for the list_tasks tool. Parses input arguments using Zod schema, queries tasks from Supabase service with optional filters (project_id, status, assignee_id, search), applies client-side filtering for initiative_id, and returns filtered tasks list with total count and applied filters.export const listTasks = requireAuth(async (args: any) => { const { project_id, initiative_id, status, assignee_id, search, limit } = ListTasksSchema.parse(args) logger.info('Listing tasks', { project_id, initiative_id, status, assignee_id, search, limit }) let tasks = await supabaseService.getTasks( { project_id, status, assignee_id, search }, { limit }, { field: 'updated_at', order: 'desc' } ) // Filter by initiative_id if provided (since API doesn't support it directly yet) if (initiative_id) { tasks = tasks.filter(task => task.initiative_id === initiative_id) } return { tasks, total: tasks.length, filters_applied: { project_id, initiative_id, status, assignee_id, search } } })
- src/tools/tasks.ts:13-20 (schema)Zod input validation schema used by the list_tasks handler to parse and validate tool arguments.const ListTasksSchema = z.object({ project_id: z.string().uuid().optional(), initiative_id: z.string().uuid().optional(), status: z.enum(['todo', 'in_progress', 'done']).optional(), assignee_id: z.string().uuid().optional(), search: z.string().optional(), limit: z.number().int().positive().max(100).default(20) })
- src/tools/tasks.ts:56-95 (registration)MCPTool definition object registering the list_tasks tool with its name, description, and JSON input schema for the Model Context Protocol.export const listTasksTool: MCPTool = { name: 'list_tasks', description: 'List tasks with optional filtering by project, initiative, status, or assignee', inputSchema: { type: 'object', properties: { project_id: { type: 'string', format: 'uuid', description: 'Filter tasks by project ID' }, initiative_id: { type: 'string', format: 'uuid', description: 'Filter tasks by initiative ID' }, status: { type: 'string', enum: ['todo', 'in_progress', 'done'], description: 'Filter tasks by status' }, assignee_id: { type: 'string', format: 'uuid', description: 'Filter tasks by assignee' }, search: { type: 'string', description: 'Search tasks by title or description' }, limit: { type: 'number', minimum: 1, maximum: 100, default: 20, description: 'Maximum number of tasks to return' } } } }
- src/tools/tasks.ts:1157-1166 (registration)Export of taskHandlers object that maps the 'list_tasks' name to the listTasks handler function, imported and spread into the main allHandlers in src/index.ts for MCP tool call dispatching.export const taskHandlers = { list_tasks: listTasks, create_task: createTask, get_task: getTask, update_task: updateTask, add_task_dependency: addTaskDependency, get_task_dependencies: getTaskDependencies, create_task_workflow: createTaskWorkflow, bulk_update_tasks: bulkUpdateTasks, get_task_workflow_status: getTaskWorkflowStatus
- src/index.ts:143-155 (registration)In the main MCP server constructor, taskHandlers (containing list_tasks) is spread into the central allHandlers object used for dynamic tool execution in CallToolRequestHandler.this.allHandlers = { ...projectHandlers, ...taskHandlers, ...documentHandlers, ...conversationHandlers, ...contextAggregationHandlers, ...workflowAutomationHandlers, ...intelligentSearchHandlers, ...analyticsInsightsHandlers, ...initiativeHandlers, ...promptToProjectTools.reduce((acc, tool) => ({ ...acc, [tool.name]: tool.handler }), {}), ...debugHandlers, }