ticket_list
List project tickets with status and priority filters to manage workflow. Retrieve IDs for detailed viewing using ticket_get.
Instructions
PROJECT MANAGEMENT: List ticket IDs with status/priority. Returns id, status, priority only - use ticket_get for details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Filter by project ID (case-insensitive) | |
| status | No | Filter by status | |
| limit | No | Max tickets to return (default: 50, max: 200) | |
| offset | No | Skip first N tickets for pagination (default: 0) |
Implementation Reference
- src/tpm_mcp/server.py:541-558 (handler)MCP tool handler for 'ticket_list': filters tickets by project_id and/or status, applies pagination, returns list of {id, status, priority} with pagination info.if name == "ticket_list": status = TicketStatus(args["status"]) if args.get("status") else None tickets = db.list_tickets(args.get("project_id"), status) # Apply pagination (default 50, max 200) - items are small now limit = min(args.get("limit", 50), 200) offset = args.get("offset", 0) total = len(tickets) tickets = tickets[offset:offset + limit] # Return IDs + essential metadata only - use ticket_get for details result = [ { "id": t.id, "status": t.status.value, "priority": t.priority.value, } for t in tickets ] return _json({"tickets": result, "offset": offset, "limit": limit, "total": total})
- src/tpm_mcp/server.py:185-209 (registration)Registration of 'ticket_list' tool via @server.list_tools(), defining name, description, and input schema for filtering and pagination.Tool( name="ticket_list", description="PROJECT MANAGEMENT: List ticket IDs with status/priority. Returns id, status, priority only - use ticket_get for details.", inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": "Filter by project ID (case-insensitive)"}, "status": { "type": "string", "enum": ["backlog", "planned", "in-progress", "done", "blocked"], "description": "Filter by status", }, "limit": { "type": "integer", "description": "Max tickets to return (default: 50, max: 200)", "default": 50, }, "offset": { "type": "integer", "description": "Skip first N tickets for pagination (default: 0)", "default": 0, }, }, }, ),
- src/tpm_mcp/db.py:422-437 (helper)TrackerDB.list_tickets(): executes SQL query to fetch tickets filtered by project_id (case-insensitive) and status, ordered by priority then created_at.def list_tickets( self, project_id: str | None = None, status: TicketStatus | None = None ) -> list[Ticket]: query = "SELECT * FROM tickets WHERE 1=1" params = [] if project_id: project_id = self._normalize_id(project_id) query += " AND LOWER(project_id) = ?" params.append(project_id) if status: query += " AND status = ?" params.append(status.value) query += " ORDER BY priority, created_at" rows = self.conn.execute(query, params).fetchall() return [self._row_to_ticket(r) for r in rows]