Skip to main content
Glama
aafsar

Task Manager MCP Server

by aafsar

list_tasks

Retrieve tasks from the Task Manager MCP Server with filters for status, priority, and category to organize and track workflow.

Instructions

List tasks with optional filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by statusall
priorityNoFilter by priorityall
categoryNoFilter by category

Implementation Reference

  • The handler function that executes the list_tasks tool logic: validates input, loads and filters tasks, sorts them, formats output with summary, and returns MCP content.
    export async function listTasks(args: unknown) {
      // Validate input
      const validated = ListTasksSchema.parse(args || {});
    
      // Load tasks
      const storage = await loadTasks();
      let tasks = [...storage.tasks];
    
      // Apply filters
      if (validated.status !== "all") {
        tasks = tasks.filter((t) => t.status === validated.status);
      }
      if (validated.priority !== "all") {
        tasks = tasks.filter((t) => t.priority === validated.priority);
      }
      if (validated.category) {
        tasks = tasks.filter(
          (t) => t.category?.toLowerCase() === validated.category?.toLowerCase()
        );
      }
    
      if (tasks.length === 0) {
        return {
          content: [
            {
              type: "text",
              text: "No tasks found matching the criteria.",
            },
          ],
        };
      }
    
      // Sort by priority and due date
      const priorityOrder: Record<Priority, number> = {
        high: 0,
        medium: 1,
        low: 2,
      };
    
      tasks.sort((a, b) => {
        const priorityDiff = priorityOrder[a.priority] - priorityOrder[b.priority];
        if (priorityDiff !== 0) return priorityDiff;
    
        const aDate = a.dueDate || "9999-99-99";
        const bDate = b.dueDate || "9999-99-99";
        return aDate.localeCompare(bDate);
      });
    
      // Format output
      let result = `šŸ“‹ Found ${tasks.length} task(s):\n\n`;
      tasks.forEach((task) => {
        result += formatTask(task) + "\n";
      });
    
      // Add summary
      const pending = storage.tasks.filter((t) => t.status === "pending").length;
      const inProgress = storage.tasks.filter(
        (t) => t.status === "in_progress"
      ).length;
      const completed = storage.tasks.filter((t) => t.status === "completed").length;
    
      result += `\nšŸ“Š Summary: ${pending} pending | ${inProgress} in progress | ${completed} completed`;
    
      return {
        content: [
          {
            type: "text",
            text: result,
          },
        ],
      };
    }
  • Zod schema used for input validation in the listTasks handler.
    export const ListTasksSchema = z.object({
      status: z
        .enum(["pending", "in_progress", "completed", "all"])
        .default("all"),
      priority: z.enum(["low", "medium", "high", "all"]).default("all"),
      category: z.string().optional(),
    });
  • src/index.ts:59-83 (registration)
    Tool registration in the TOOLS array returned by listTools, including name, description, and inputSchema.
    {
      name: "list_tasks",
      description: "List tasks with optional filters",
      inputSchema: {
        type: "object",
        properties: {
          status: {
            type: "string",
            enum: ["pending", "in_progress", "completed", "all"],
            default: "all",
            description: "Filter by status",
          },
          priority: {
            type: "string",
            enum: ["low", "medium", "high", "all"],
            default: "all",
            description: "Filter by priority",
          },
          category: {
            type: "string",
            description: "Filter by category",
          },
        },
      },
    },
  • src/index.ts:218-219 (registration)
    Dispatch to the listTasks handler in the CallToolRequest switch statement.
    case "list_tasks":
      return await listTasks(args);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states that it lists tasks with optional filters, lacking details on permissions, rate limits, pagination, or response format. For a read operation with no annotation coverage, this leaves significant gaps in understanding how the tool behaves beyond basic functionality.

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 extremely concise with a single sentence that front-loads the core purpose ('List tasks') and adds essential context ('with optional filters'). There is no wasted language, making it efficient and easy to parse for an agent, though it could benefit from more detail in other dimensions.

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 the lack of annotations and output schema, the description is incomplete for a tool with three parameters and multiple siblings. It doesn't explain return values, error handling, or when to prefer this over similar tools like 'search_tasks'. For a list operation in a task management context, more guidance on behavior and usage is needed to be fully helpful.

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%, with clear descriptions for all parameters (status, priority, category). The description adds no additional meaning beyond the schema, as it only mentions 'optional filters' without elaborating on parameter usage or interactions. This meets the baseline for high schema coverage, where 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 'List' and resource 'tasks' with the purpose of retrieving tasks with optional filtering. It distinguishes from siblings like 'search_tasks' by focusing on listing rather than searching, though it doesn't explicitly differentiate them. The purpose is specific and actionable, making it easy for an agent to understand the core function.

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?

The description provides no guidance on when to use this tool versus alternatives like 'search_tasks' or 'get_task_stats'. It mentions optional filters but doesn't specify scenarios or prerequisites for usage. Without any context on exclusions or comparisons, the agent must infer usage from the tool name alone, which is insufficient for optimal selection.

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/aafsar/task-manager-mcp-server'

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