plan_sprint
Organize and schedule sprints by selecting GitHub issues, defining goals, and setting start and end dates for efficient project management.
Instructions
Plan a new sprint with selected issues
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueIds | Yes | ||
| sprint | Yes |
Implementation Reference
- Main handler implementation for plan_sprint tool. Validates input, creates sprint via GitHubSprintRepository, associates issues by updating their milestoneId to sprint ID.async planSprint(data: { sprint: CreateSprint; issueIds: number[]; }): Promise<Sprint> { try { // Validate input with Zod schema const validatedData = PlanSprintSchema.parse(data); const stringIssueIds = validatedData.issueIds.map(id => id.toString()); // Create sprint with proper error handling const sprint = await this.sprintRepo.create({ ...validatedData.sprint, issues: stringIssueIds, status: validatedData.sprint.status || ResourceStatus.PLANNED }); // Create relationship between issues and sprint if (stringIssueIds.length > 0) { try { await Promise.all( stringIssueIds.map(async (issueId) => { try { await this.issueRepo.update(issueId, { milestoneId: sprint.id }); } catch (error) { process.stderr.write(`Failed to associate issue ${issueId} with sprint: ${error}`); throw this.mapErrorToMCPError(error); } }) ); } catch (error) { throw this.mapErrorToMCPError(error); } } return sprint; } catch (error) { if (error instanceof z.ZodError) { throw new ValidationError(`Invalid sprint data: ${error.message}`); } throw this.mapErrorToMCPError(error); } }
- ToolDefinition for plan_sprint including Zod input schema (planSprintSchema), description, and usage examples.export const planSprintTool: ToolDefinition<PlanSprintArgs> = { name: "plan_sprint", description: "Plan a new sprint with selected issues", schema: planSprintSchema as unknown as ToolSchema<PlanSprintArgs>, examples: [ { name: "Two-week sprint", description: "Plan a two-week sprint with specific issues", args: { sprint: { title: "Sprint 1: Authentication and Onboarding", startDate: "2025-05-01T00:00:00Z", endDate: "2025-05-15T00:00:00Z", goals: [ "Complete user authentication flow", "Implement onboarding screens", ], }, issueIds: ["1", "2", "3", "5"], }, }, ], };
- src/infrastructure/tools/ToolRegistry.ts:185-186 (registration)Registration of planSprintTool in the central ToolRegistry singleton.this.registerTool(createRoadmapTool); this.registerTool(planSprintTool);
- src/index.ts:243-244 (handler)MCP server tool dispatch handler that routes plan_sprint calls to ProjectManagementService.planSprint.case "plan_sprint": return await this.service.planSprint(args);
- Zod input validation schema for plan_sprint tool parameters.// Schema for plan_sprint tool export const planSprintSchema = z.object({ sprint: z.object({ title: z.string().min(1, "Sprint title is required"), startDate: z.string().datetime("Start date must be a valid ISO date string"), endDate: z.string().datetime("End date must be a valid ISO date string"), goals: z.array(z.string()), }), issueIds: z.array(z.string()), });