Skip to main content
Glama

project_list

List and filter projects with epic/task counts and completion percentages to track progress in a structured database.

Instructions

List all projects with epic/task counts and completion percentages. Optionally filter by status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by status

Implementation Reference

  • Handler function for the project_list tool.
    function handleProjectList(args: Record<string, unknown>) {
      const db = getDb();
      const status = args.status as string | undefined;
    
      let sql = `
        SELECT p.*,
          COUNT(DISTINCT e.id) as epic_count,
          COUNT(DISTINCT t.id) as task_count,
          SUM(CASE WHEN t.status = 'done' THEN 1 ELSE 0 END) as done_count,
          CASE WHEN COUNT(DISTINCT t.id) > 0
            THEN ROUND(SUM(CASE WHEN t.status = 'done' THEN 1 ELSE 0 END) * 100.0 / COUNT(DISTINCT t.id), 1)
            ELSE 0 END as completion_pct
        FROM projects p
        LEFT JOIN epics e ON e.project_id = p.id
        LEFT JOIN tasks t ON t.epic_id = e.id
      `;
    
      const params: unknown[] = [];
      if (status) {
        sql += ' WHERE p.status = ?';
        params.push(status);
      }
    
      sql += ' GROUP BY p.id ORDER BY p.created_at DESC';
    
      return db.prepare(sql).all(...params);
    }
  • Definition and input schema for the project_list tool.
    {
      name: 'project_list',
      description:
        'List all projects with epic/task counts and completion percentages. Optionally filter by status.',
      annotations: { title: 'List Projects', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          status: {
            type: 'string',
            enum: ['active', 'on_hold', 'completed', 'archived'],
            description: 'Filter by status',
          },
        },
      },
    },
  • Registration of the project_list handler.
    export const handlers: Record<string, ToolHandler> = {
      project_create: handleProjectCreate,
      project_list: handleProjectList,

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/spranab/saga-mcp'

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