Skip to main content
Glama

task_list

Read-onlyIdempotent

List and filter project tasks with status, priority, assignee, and tag options. View subtask counts and dependencies across epics or specific projects.

Instructions

List tasks with optional filters. If no epic_id given, lists across ALL epics. Includes subtask counts and dependency info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
epic_idNoFilter by epic (omit for all tasks)
statusNo
priorityNo
assigned_toNoFilter by assignee
tagNoFilter by tag
sort_byNoSort order: priority (critical first), created (newest first), due_date (earliest first), status (actionable first)priority
limitNoMax results

Implementation Reference

  • The 'handleTaskList' function, which executes the logic for listing tasks, including optional filtering by epic, status, priority, assignee, tag, sorting, and limit.
    function handleTaskList(args: Record<string, unknown>) {
      const db = getDb();
      const epicId = args.epic_id as number | undefined;
      const status = args.status as string | undefined;
      const priority = args.priority as string | undefined;
      const assignedTo = args.assigned_to as string | undefined;
      const tag = args.tag as string | undefined;
      const sortBy = (args.sort_by as string) ?? 'priority';
      const limit = (args.limit as number) ?? 50;
    
      const whereClauses: string[] = [];
      const params: unknown[] = [];
    
      if (epicId !== undefined) {
        whereClauses.push('t.epic_id = ?');
        params.push(epicId);
      }
      if (status) {
        whereClauses.push('t.status = ?');
        params.push(status);
      }
      if (priority) {
        whereClauses.push('t.priority = ?');
        params.push(priority);
      }
      if (assignedTo) {
        whereClauses.push('t.assigned_to = ?');
        params.push(assignedTo);
      }
      if (tag) {
        addTagFilter(whereClauses, params, tag, 't');
      }
    
      const whereStr = whereClauses.length > 0 ? `WHERE ${whereClauses.join(' AND ')}` : '';
    
      const sql = `
        SELECT t.*,
          e.name as epic_name,
          COUNT(DISTINCT s.id) as subtask_count,
          SUM(CASE WHEN s.status = 'done' THEN 1 ELSE 0 END) as subtask_done_count,
          (SELECT COUNT(*) FROM task_dependencies d
           JOIN tasks dt ON dt.id = d.depends_on_task_id AND dt.status != 'done'
           WHERE d.task_id = t.id) as blocked_by_count
        FROM tasks t
        JOIN epics e ON e.id = t.epic_id
        LEFT JOIN subtasks s ON s.task_id = t.id
        ${whereStr}
        GROUP BY t.id
        ORDER BY ${getTaskOrderClause(sortBy)}
        LIMIT ?
      `;
    
      params.push(limit);
      return db.prepare(sql).all(...params);
    }
  • The tool definition for 'task_list', specifying its input schema, description, and annotations.
    {
      name: 'task_list',
      description:
        'List tasks with optional filters. If no epic_id given, lists across ALL epics. Includes subtask counts and dependency info.',
      annotations: { title: 'List Tasks', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          epic_id: { type: 'integer', description: 'Filter by epic (omit for all tasks)' },
          status: { type: 'string', enum: ['todo', 'in_progress', 'review', 'done', 'blocked'] },
          priority: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
          assigned_to: { type: 'string', description: 'Filter by assignee' },
          tag: { type: 'string', description: 'Filter by tag' },
          sort_by: {
            type: 'string',
            enum: ['priority', 'created', 'due_date', 'status'],
            default: 'priority',
            description: 'Sort order: priority (critical first), created (newest first), due_date (earliest first), status (actionable first)',
          },
          limit: { type: 'integer', default: 50, description: 'Max results' },
        },
      },
    },
  • The mapping of the 'task_list' tool name to its handler function 'handleTaskList' in the 'handlers' registry object.
    task_list: handleTaskList,
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true, idempotentHint=true, and destructiveHint=false, indicating safe, repeatable reads. The description adds valuable context beyond annotations by specifying that results 'Includes subtask counts and dependency info,' which helps the agent understand the return format. No contradictions with annotations exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core purpose ('List tasks with optional filters'), followed by specific behavioral details. Every sentence adds value without redundancy, making it efficient and well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (7 parameters, no output schema), the description is reasonably complete. It covers the purpose, key behavioral trait (subtask/dependency info), and a parameter nuance (epic_id). However, it could improve by mentioning pagination (implied by 'limit') or error cases, but annotations provide safety context, making it adequate overall.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 71%, with all parameters having descriptions or enums in the schema. The description adds minimal semantics by mentioning the epic_id filter behavior ('omit for all tasks'), but doesn't elaborate on other parameters like status or priority beyond what the schema provides. Baseline 3 is appropriate given the high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('tasks') with optional filters. It distinguishes from sibling tools like 'task_get' (single task) and 'tracker_search' (broader search) by focusing on listing with filters. However, it doesn't explicitly differentiate from 'task_batch_update' or 'epic_list' which might have overlapping contexts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance by mentioning 'If no epic_id given, lists across ALL epics,' which suggests when to use this parameter. However, it lacks explicit guidance on when to choose this tool over alternatives like 'tracker_search' or 'epic_list' for task-related queries, and doesn't mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/spranab/saga-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server