Skip to main content
Glama

list_tasks

View all tasks in a project organized by status columns. Provide a project slug to retrieve tasks with their current status and order.

Instructions

Lists all tasks within a project using the project slug (e.g., 'CDB'). Returns tasks organized by status columns with their order and current status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYes

Implementation Reference

  • The main handler function that executes the list_tasks tool. It fetches tasks for a given project slug from the API, processes the response, sorts tasks by number, and returns formatted project and task information or handles errors.
    async execute(input: ListTasksInput): Promise<unknown> {
      logger.info('Executing list-tasks tool', input);
    
      try {
        // Use the injected API client to get task list
        if (!this.apiClient) {
          throw new Error('API client not available - tool not properly initialized');
        }
    
        const url = `/task/project/slug/${input.slug.toUpperCase()}`;
        logger.debug(`Making GET request to: ${url}`);
        
        const responseData = await this.apiClient.get<TaskListApiResponse>(url) as unknown as TaskListApiResponse;
        
        if (!responseData) {
          logger.warn(`No project found or invalid response format from ${url}`);
          return {
            isError: true,
            content: [{ type: "text", text: `Project with slug '${input.slug}' not found` }]
          };
        }
        
        // Calculate total task count across all columns
        const totalTasks = responseData.columns?.reduce((total, column) => total + (column.tasks?.length || 0), 0) || 0;
        
        // Return formatted task list with project info and organized tasks
        return {
          project: {
            id: responseData.id,
            name: responseData.name,
            slug: responseData.slug,
            status: responseData.status
          },
          taskSummary: {
            totalTasks,
            statusBreakdown: responseData.columns?.map(column => ({
              status: column.id,
              name: column.name,
              count: column.tasks?.length || 0
            })) || []
          },
          tasksByStatus: responseData.columns?.map(column => ({
            status: column.id,
            name: column.name,
            tasks: column.tasks?.map(task => ({
              number: task.number,
              title: task.title,
              description: task.description,
              status: task.status,
              priority: task.priority,
              position: task.position,
              hasContext: !!task.context,
              hasInstructions: !!task.instructions
            })).sort((a, b) => {
              // Sort tasks by their number (e.g., CDB-1, CDB-2, CDB-3, etc.)
              const getTaskNumber = (taskNumber: string) => {
                const match = taskNumber.match(/^[A-Z]{3}-(\d+)$/);
                return match ? parseInt(match[1], 10) : 0;
              };
              return getTaskNumber(a.number) - getTaskNumber(b.number);
            }) || []
          })) || []
        };
      } catch (error) {
        const errorMessage = (error instanceof Error) ? error.message : 'An unknown error occurred';
        logger.error(`Error in task-list tool: ${errorMessage}`, error instanceof Error ? error : undefined);
        
        return {
          isError: true,
          content: [{ type: "text", text: errorMessage }]
        };
      }
    }
  • Zod schema defining the input parameters for the list_tasks tool, specifically requiring a three-letter project slug.
    const ListTasksSchema = z.object({
      // Project slug (URL-friendly identifier)
      slug: z.string({
        required_error: "Project slug is required"
      })
        .regex(/^[A-Za-z]{3}$/, { message: "Project slug must be three letters (e.g., CDB or cdb). Case insensitive." }),
    }).strict();
  • src/index.ts:328-330 (registration)
    Registration loop that calls register() on all tool instances, including ListTasksTool, to register them with the MCP server.
    tools.forEach(tool => {
      tool.register(server);
    });
  • src/index.ts:323-323 (registration)
    Instantiation of the ListTasksTool class with dependency-injected SecureApiClient, added to the tools array for subsequent registration.
    new ListTasksTool(secureApiClient),
  • Helper method that generates agent instructions after executing list_tasks, providing guidance on next steps and workflow recommendations.
    protected generateAgentInstructions(input: ListTasksInput, result: any): AgentInstructions {
      return {
        immediateActions: [
          "Review available tasks and their current status",
          "Help user select appropriate task to work on",
          "Consider task status (to-do, in-progress, completed) for workflow planning"
        ],
        nextRecommendedTools: ["get_project", "get_task"],
        workflowPhase: 'discovery',
        criticalReminders: [
          "Always establish project context before starting selected task",
          "Follow optimal workflow: get_project → get_task → get_prompt"
        ],
        automationHints: {
          taskSelection: "Guide user to select tasks based on priority and dependencies",
          workflowGuidance: "Ensure project context is established before task work begins"
        }
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden. It discloses the return format ('organized by status columns') and ordering ('with their order'), which is useful. However, it lacks critical behavioral details: whether this is a read-only operation, if it requires authentication, pagination behavior, rate limits, or error conditions. For a list operation with zero annotation coverage, this leaves significant gaps.

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 efficiently structured in two sentences: the first states the action and required input, the second describes the return format. Every element serves a purpose with no redundant information, making it easy to parse and understand quickly.

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

Completeness3/5

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

Given 1 parameter with no output schema and no annotations, the description adequately covers the basic purpose and parameter meaning. However, it lacks completeness for a list operation: no mention of pagination, filtering options, sorting, error handling, or authentication requirements. The return format description is helpful but doesn't fully compensate for missing structural context.

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

Parameters4/5

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

The schema has 1 parameter with 0% description coverage, so the description must compensate. It explains the 'slug' parameter meaning ('project slug') and provides an example format ('e.g., "CDB"'), which aligns with the schema's pattern constraint. This adds substantial value beyond the bare schema, though it doesn't detail the pattern's exact rules (3 letters).

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 ('Lists') and resource ('tasks within a project'), specifying the scope ('using the project slug') and return format ('organized by status columns with their order and current status'). It distinguishes from siblings like 'get_task' (single task) and 'list_projects' (different resource), but doesn't explicitly contrast with 'next_task' or 'get_project'.

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 implies usage when needing all tasks in a project, but provides no explicit guidance on when to use this versus alternatives like 'get_task' (single task) or 'next_task' (next actionable task). It mentions the required parameter ('project slug') but doesn't clarify 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/PixdataOrg/coderide-mcp'

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