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);

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