Skip to main content
Glama

list_tasks

Create and manage structured task lists with status tracking, priorities, and dependencies. Organize tasks by status (pending, in progress, completed) to streamline workflows efficiently.

Instructions

Generate a structured task list, including complete status tracking, priority, and dependencies

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYesTask status to list, can choose 'all' to list all tasks, or specify specific status

Implementation Reference

  • The main handler function for the 'list_tasks' tool. It fetches all tasks, filters them by the provided status ('all', 'pending', 'in_progress', or 'completed'), handles empty results, groups tasks by status, generates a prompt using getListTasksPrompt, and returns it as tool content.
    export async function listTasks({ status }: z.infer<typeof listTasksSchema>) {
      const tasks = await getAllTasks();
      let filteredTasks = tasks;
      switch (status) {
        case "all":
          break;
        case "pending":
          filteredTasks = tasks.filter(
            (task) => task.status === TaskStatus.PENDING
          );
          break;
        case "in_progress":
          filteredTasks = tasks.filter(
            (task) => task.status === TaskStatus.IN_PROGRESS
          );
          break;
        case "completed":
          filteredTasks = tasks.filter(
            (task) => task.status === TaskStatus.COMPLETED
          );
          break;
      }
    
      if (filteredTasks.length === 0) {
        return {
          content: [
            {
              type: "text" as const,
              text: `## System Notification\n\nCurrently, there are no ${
                status === "all" ? "any" : `any ${status} `
              }tasks in the system. Please query other status tasks or first use the "split_tasks" tool to create task structure, then proceed with subsequent operations.`,
            },
          ],
        };
      }
    
      const tasksByStatus = tasks.reduce((acc, task) => {
        if (!acc[task.status]) {
          acc[task.status] = [];
        }
        acc[task.status].push(task);
        return acc;
      }, {} as Record<string, typeof tasks>);
    
      // Use prompt generator to get the final prompt
      const prompt = getListTasksPrompt({
        status,
        tasks: tasksByStatus,
        allTasks: filteredTasks,
      });
    
      return {
        content: [
          {
            type: "text" as const,
            text: prompt,
          },
        ],
      };
    }
  • Zod schema defining the input for 'list_tasks': an object with 'status' field (enum: 'all', 'pending', 'in_progress', 'completed').
    export const listTasksSchema = z.object({
      status: z
        .enum(["all", "pending", "in_progress", "completed"])
        .describe("Task status to list, can choose 'all' to list all tasks, or specify specific status"),
    });
  • src/index.ts:256-260 (registration)
    Registration of the 'list_tasks' tool in the MCP server's ListToolsRequestHandler, providing name, description from template, and input schema converted to JSON schema.
    name: "list_tasks",
    description: loadPromptFromTemplate(
      "toolsDescription/listTasks.md"
    ),
    inputSchema: zodToJsonSchema(listTasksSchema),
  • src/index.ts:432-442 (registration)
    Handler registration for 'list_tasks' in the MCP server's CallToolRequestHandler: validates arguments with listTasksSchema, calls the listTasks function, and returns the result.
    case "list_tasks":
      parsedArgs = await listTasksSchema.safeParseAsync(
        request.params.arguments
      );
      if (!parsedArgs.success) {
        throw new Error(
          `Invalid arguments for tool ${request.params.name}: ${parsedArgs.error.message}`
        );
      }
      result = await listTasks(parsedArgs.data);
      return result;
  • Import of getListTasksPrompt helper used in the listTasks handler to generate the formatted prompt output.
    import {
      getPlanTaskPrompt,
      getAnalyzeTaskPrompt,
      getReflectTaskPrompt,
      getSplitTasksPrompt,
      getExecuteTaskPrompt,
      getVerifyTaskPrompt,
      getCompleteTaskPrompt,
      getListTasksPrompt,
Behavior2/5

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

With no annotations, the description carries full burden but only states what the tool does, not behavioral traits like whether it's read-only, requires permissions, returns paginated results, or handles errors. It mentions 'complete status tracking' but doesn't explain how status is tracked or displayed.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core action ('Generate a structured task list') and lists key features. It avoids redundancy but could be slightly more structured for clarity.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a tool that likely returns complex data (task lists with tracking, priority, dependencies). It doesn't explain return format, data structure, or how attributes like dependencies are represented, leaving significant gaps for the agent.

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 100%, so the schema fully documents the single 'status' parameter with enum values. The description adds no parameter-specific details beyond implying status tracking, which is already covered. Baseline 3 is appropriate as the schema does the heavy lifting.

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 'Generate' and resource 'structured task list' with specific attributes (status tracking, priority, dependencies). It distinguishes from siblings like 'query_task' or 'get_task_detail' by emphasizing generation and structure, though it doesn't explicitly name alternatives.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus siblings like 'query_task' or 'get_task_detail' is provided. The description implies listing tasks but doesn't specify contexts or exclusions, leaving the agent to infer usage based on tool names alone.

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

Related 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/liorfranko/mcp-chain-of-thought'

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