Skip to main content
Glama

list_tasks

Filter and organize tasks by status or priority to streamline task management and improve productivity. Designed for efficient task tracking and prioritization within structured workflows.

Instructions

List tasks with optional filtering by status and priority.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
priorityNoFilter tasks by priority level
statusNoFilter tasks by status

Implementation Reference

  • The execute function for the 'list_tasks' tool. Validates parameters using ListTasksSchema, retrieves all tasks from taskStorage, applies optional filters by status and priority, and returns the filtered list with count.
    execute: async (params: any) => {
      try {
        // Validate input parameters
        const validatedParams = ListTasksSchema.parse(params);
        const allTasks = taskStorage.getAll();
        
        const filter: Partial<Task> = {};
        if (validatedParams.status) filter.status = validatedParams.status;
        if (validatedParams.priority) filter.priority = validatedParams.priority;
        
        // Apply filters if any
        const filteredTasks = Object.keys(filter).length > 0
          ? allTasks.filter(task => {
              return Object.entries(filter).every(([key, value]) => 
                task[key as keyof Task] === value
              );
            })
          : allTasks;
        
        return JSON.stringify({
          tasks: filteredTasks,
          count: filteredTasks.length,
          filters: Object.keys(filter).length > 0 ? filter : "none"
        });
      } catch (error) {
        return JSON.stringify({ 
          error: `Invalid list parameters: ${error instanceof Error ? error.message : String(error)}`
        });
      }
    }
  • Zod schema defining optional parameters for list_tasks: status (TaskStatusEnum) and priority (TaskPriorityEnum).
    // Schema for list_tasks parameters
    const ListTasksSchema = z.object({
      status: TaskStatusEnum.optional(),
      priority: TaskPriorityEnum.optional()
    });
  • Registration of the 'list_tasks' tool on the FastMCP server instance, specifying name, description, and execute handler.
    server.addTool({
      name: "list_tasks",
      description: "List tasks with optional filtering by status and priority.",
      execute: async (params: any) => {
        try {
          // Validate input parameters
          const validatedParams = ListTasksSchema.parse(params);
          const allTasks = taskStorage.getAll();
          
          const filter: Partial<Task> = {};
          if (validatedParams.status) filter.status = validatedParams.status;
          if (validatedParams.priority) filter.priority = validatedParams.priority;
          
          // Apply filters if any
          const filteredTasks = Object.keys(filter).length > 0
            ? allTasks.filter(task => {
                return Object.entries(filter).every(([key, value]) => 
                  task[key as keyof Task] === value
                );
              })
            : allTasks;
          
          return JSON.stringify({
            tasks: filteredTasks,
            count: filteredTasks.length,
            filters: Object.keys(filter).length > 0 ? filter : "none"
          });
        } catch (error) {
          return JSON.stringify({ 
            error: `Invalid list parameters: ${error instanceof Error ? error.message : String(error)}`
          });
        }
      }
    });
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions optional filtering but doesn't disclose behavioral traits like pagination, rate limits, authentication needs, or what happens with no parameters (e.g., lists all tasks). For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 a single, efficient sentence that front-loads the core purpose ('List tasks') and adds essential detail ('with optional filtering'). Every word earns its place with no redundancy or fluff, making it easy to parse quickly.

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, no output schema, and a read operation with filtering, the description is incomplete. It doesn't explain return values (e.g., task list format), error conditions, or practical usage context. For a tool with 2 parameters and behavioral uncertainty, more information would help the agent use it effectively.

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 both parameters ('priority' and 'status') fully documented in the schema including enum values. The description adds minimal value by noting filtering is optional but doesn't provide additional semantics beyond what the schema already states. Baseline 3 is appropriate when 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'), making the purpose immediately understandable. It distinguishes from siblings like 'update_tasks' or 'next_task' by focusing on listing rather than modifying or selecting. However, it doesn't explicitly differentiate from other listing tools (none present in siblings), so it's not a perfect 5.

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. It doesn't mention prerequisites, compare to siblings like 'search_nodes' or 'memory_query', or specify scenarios where filtering is beneficial. The agent must infer usage from the tool name 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/flight505/mcp-think-tank'

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