Skip to main content
Glama

epic_list

Read-onlyIdempotent

List project epics with task counts and completion statistics. Filter by status or priority to track progress in structured project management.

Instructions

List epics for a project with task counts and completion stats. Optionally filter by status or priority.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID
statusNo
priorityNo

Implementation Reference

  • Handler function for the 'epic_list' tool. Executes a SQL query to fetch epics with task count statistics.
    function handleEpicList(args: Record<string, unknown>) {
      const db = getDb();
      const projectId = args.project_id as number;
      const status = args.status as string | undefined;
      const priority = args.priority as string | undefined;
    
      const whereClauses = ['e.project_id = ?'];
      const params: unknown[] = [projectId];
    
      if (status) {
        whereClauses.push('e.status = ?');
        params.push(status);
      }
      if (priority) {
        whereClauses.push('e.priority = ?');
        params.push(priority);
      }
    
      const sql = `
        SELECT e.*,
          COUNT(t.id) as task_count,
          SUM(CASE WHEN t.status = 'done' THEN 1 ELSE 0 END) as done_count,
          SUM(CASE WHEN t.status = 'blocked' THEN 1 ELSE 0 END) as blocked_count,
          CASE WHEN COUNT(t.id) > 0
            THEN ROUND(SUM(CASE WHEN t.status = 'done' THEN 1 ELSE 0 END) * 100.0 / COUNT(t.id), 1)
            ELSE 0 END as completion_pct
        FROM epics e
        LEFT JOIN tasks t ON t.epic_id = e.id
        WHERE ${whereClauses.join(' AND ')}
        GROUP BY e.id
        ORDER BY e.sort_order, e.created_at
      `;
    
      return db.prepare(sql).all(...params);
    }
  • MCP Tool definition for 'epic_list' including description and input schema.
    {
      name: 'epic_list',
      description:
        'List epics for a project with task counts and completion stats. Optionally filter by status or priority.',
      annotations: { title: 'List Epics', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          project_id: { type: 'integer', description: 'Project ID' },
          status: { type: 'string', enum: ['planned', 'in_progress', 'completed', 'cancelled'] },
          priority: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
        },
        required: ['project_id'],
      },
    },
  • Registration map of tool names to their corresponding handler functions.
    export const handlers: Record<string, ToolHandler> = {
      epic_create: handleEpicCreate,
      epic_list: handleEpicList,
      epic_update: handleEpicUpdate,
    };
Behavior3/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds context about what data is returned (task counts and completion stats) but doesn't mention pagination, rate limits, authentication needs, or response format details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently communicates the core functionality and optional features. It's appropriately sized for a list operation with filtering capabilities, though it could potentially be more front-loaded with the most critical information.

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 read-only list tool with good annotation coverage but no output schema, the description provides basic functionality but lacks details about response format, pagination, error conditions, or how the 'task counts and completion stats' are structured. It's minimally adequate but has clear gaps in completeness.

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 only 33% (only project_id has a description). The description mentions optional filtering by status or priority, which aligns with the two enum parameters, but doesn't explain what these filters do or provide additional semantic context beyond what the schema's enum values already indicate.

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 ('epics for a project') with additional context about what data is included ('task counts and completion stats'). It distinguishes from general list tools but doesn't explicitly differentiate from sibling 'epic_create' or 'epic_update' beyond the 'list' action.

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 context ('for a project') and mentions optional filtering capabilities, but doesn't provide explicit guidance on when to use this versus alternatives like 'tracker_search' or 'project_list'. No when-not-to-use or prerequisite information is included.

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

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