list_sprints
Retrieve all sprints from GitHub projects to track development progress and manage workflows based on status.
Instructions
List all sprints
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes |
Input Schema (JSON Schema)
{
"properties": {
"status": {
"type": "string"
}
},
"required": [
"status"
],
"type": "object"
}
Implementation Reference
- Core handler function that fetches all sprints from the GitHubSprintRepository and filters them by the provided status ('planned', 'active', 'completed', or 'all'). Maps status strings to ResourceStatus enum and handles errors.async listSprints(status: string = 'all'): Promise<Sprint[]> { try { const sprints = await this.sprintRepo.findAll(); // Filter by status if needed if (status !== 'all') { let resourceStatus; switch(status) { case 'planned': resourceStatus = ResourceStatus.PLANNED; break; case 'active': resourceStatus = ResourceStatus.ACTIVE; break; case 'completed': resourceStatus = ResourceStatus.COMPLETED; break; default: return sprints; } return sprints.filter(sprint => sprint.status === resourceStatus); } return sprints; } catch (error) { throw this.mapErrorToMCPError(error); } }
- Zod schema definition for list_sprints tool input, validating optional 'status' parameter with enum values.// Schema for list_sprints tool export const listSprintsSchema = z.object({ status: z.enum(["planned", "active", "completed", "all"]).default("all"), }); export type ListSprintsArgs = z.infer<typeof listSprintsSchema>;
- ToolDefinition for list_sprints including name, description, schema reference, and usage examples.export const listSprintsTool: ToolDefinition<ListSprintsArgs> = { name: "list_sprints", description: "List all sprints", schema: listSprintsSchema as unknown as ToolSchema<ListSprintsArgs>, examples: [ { name: "List active sprints", description: "List all currently active sprints", args: { status: "active" } } ] };
- src/infrastructure/tools/ToolRegistry.ts:162-162 (registration)Registers the listSprintsTool in the central ToolRegistry singleton instance.this.registerTool(listSprintsTool);
- src/index.ts:298-299 (handler)MCP tool dispatcher switch case that routes list_sprints calls to ProjectManagementService.listSprints.case "list_sprints": return await this.service.listSprints(args.status);