Skip to main content
Glama

list_projects

View all projects and their details (ID, initial prompt, task counts) in the MCP task queue system. Optional filters: open, pending_approval, completed, or all states.

Instructions

List all projects in the system and their basic information (ID, initial prompt, task counts), optionally filtered by state (open, pending_approval, completed, all).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNoFilter projects by state. 'open' (any incomplete task), 'pending_approval' (any tasks awaiting approval), 'completed' (all tasks done and approved), or 'all' to skip filtering.

Implementation Reference

  • The tool executor (handler) for 'list_projects'. Validates the optional 'state' parameter and delegates execution to TaskManager.listProjects, returning the raw result data.
    const listProjectsToolExecutor: ToolExecutor = {
      name: "list_projects",
      async execute(taskManager, args) {
        // 1. Argument Validation
        const state = validateOptionalStateParam(args.state, [
          "open",
          "pending_approval",
          "completed",
          "all",
        ]);
    
        // 2. Core Logic Execution
        const resultData = await taskManager.listProjects(state as any);
    
        // 3. Return raw success data
        return resultData;
      },
    };
  • Core helper method in TaskManager that implements the listing logic: reloads data, filters projects by optional state, computes stats, and returns structured ListProjectsSuccessData.
    public async listProjects(state?: TaskState): Promise<ListProjectsSuccessData> {
      await this.ensureInitialized();
      await this.reloadFromDisk();
    
      if (state && !["all", "open", "completed", "pending_approval"].includes(state)) {
        throw new AppError(`Invalid state filter: ${state}`, AppErrorCode.InvalidState);
      }
    
      let filteredProjects = [...this.data.projects];
    
      if (state && state !== "all") {
        filteredProjects = filteredProjects.filter((p) => {
          switch (state) {
            case "open":
              return !p.completed;
            case "completed":
              return p.completed;
            case "pending_approval":
              return !p.completed && p.tasks.every((t) => t.status === "done");
            default:
              return true;
          }
        });
      }
    
      return {
        message: `Current projects in the system:`,
        projects: filteredProjects.map((p) => ({
          projectId: p.projectId,
          initialPrompt: p.initialPrompt,
          totalTasks: p.tasks.length,
          completedTasks: p.tasks.filter((t) => t.status === "done").length,
          approvedTasks: p.tasks.filter((t) => t.approved).length,
        })),
      };
    }
  • Tool definition including input schema for 'list_projects', specifying optional 'state' enum for filtering.
    const listProjectsTool: Tool = {
      name: "list_projects",
      description: "List all projects in the system and their basic information (ID, initial prompt, task counts), optionally filtered by state (open, pending_approval, completed, all).",
      inputSchema: {
        type: "object",
        properties: {
          state: {
            type: "string",
            enum: ["open", "pending_approval", "completed", "all"],
            description: "Filter projects by state. 'open' (any incomplete task), 'pending_approval' (any tasks awaiting approval), 'completed' (all tasks done and approved), or 'all' to skip filtering.",
          },
        },
        required: [],
      },
    };
  • TypeScript interface defining the output structure returned by the list_projects tool.
    export interface ListProjectsSuccessData {
      message: string;
      projects: Array<{
        projectId: string;
        initialPrompt: string;
        totalTasks: number;
        completedTasks: number;
        approvedTasks: number;
      }>;
    }
  • Registers the listProjectsToolExecutor in the toolExecutorMap used by executeToolAndHandleErrors.
    toolExecutorMap.set(listProjectsToolExecutor.name, listProjectsToolExecutor);
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 it's a list operation. It doesn't disclose behavioral traits like pagination, rate limits, permissions needed, or whether it returns all projects at once. For a list tool with zero annotation coverage, this is inadequate.

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?

Single sentence efficiently conveys purpose, output details, and optional filtering. No wasted words, front-loaded with core functionality. Every element earns its place.

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?

For a simple list tool with 1 parameter and no output schema, the description covers basics but lacks behavioral context. Without annotations or output schema, it should explain return format or limitations more clearly. It's minimally adequate but has gaps.

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 parameter. The description adds minimal value by mentioning the filtering option but doesn't provide additional semantics beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/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 ('projects in the system') with specific output details ('basic information: ID, initial prompt, task counts'). It distinguishes from siblings like 'read_project' (singular detail) and 'list_tasks' (different resource).

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

Usage Guidelines4/5

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

The description provides clear context for when to use it ('list all projects... optionally filtered by state'), but doesn't explicitly state when not to use it or name alternatives. It implies usage vs. 'read_project' for single projects but lacks explicit comparison.

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/chriscarrollsmith/taskqueue-mcp'

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