create_sprint
Create a sprint in Jira by providing a name and origin board ID; optionally include start date, end date, or goal.
Instructions
Create a new sprint. Sprint name and origin board ID are required. Start date, end date, and goal are optional.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the sprint to create. | |
| originBoardId | Yes | ID of the board where the sprint will be created. | |
| startDate | No | Start date of the sprint (ISO 8601 format). | |
| endDate | No | End date of the sprint (ISO 8601 format). | |
| goal | No | Goal or objective of the sprint. |
Implementation Reference
- src/tools/sprints.ts:283-303 (handler)The handler function for the 'create_sprint' tool. Validates args using createSprintSchema, calls jiraClient.createSprint(), and returns essential sprint fields (id, name, state, goal).
case 'create_sprint': { const validatedArgs = await createSprintSchema.validate(args); const result = await jiraClient.createSprint(validatedArgs); // Extract only essential fields const essentialSprint = { id: result.id, name: result.name, state: result.state, goal: result.goal }; return { content: [ { type: 'text', text: JSON.stringify(essentialSprint, null, 2), }, ], }; } - src/tools/sprints.ts:103-132 (registration)Tool registration for 'create_sprint' in createSprintTools(). Defines name, description, and inputSchema with required fields (name, originBoardId) and optional fields (startDate, endDate, goal).
{ name: 'create_sprint', description: 'Create a new sprint. Sprint name and origin board ID are required. Start date, end date, and goal are optional.', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the sprint to create.', }, originBoardId: { type: 'number', description: 'ID of the board where the sprint will be created.', }, startDate: { type: 'string', description: 'Start date of the sprint (ISO 8601 format).', }, endDate: { type: 'string', description: 'End date of the sprint (ISO 8601 format).', }, goal: { type: 'string', description: 'Goal or objective of the sprint.', }, }, required: ['name', 'originBoardId'], }, }, - src/schemas/index.ts:219-225 (schema)Yup validation schema for create_sprint. Requires 'name' and 'originBoardId', with optional 'startDate', 'endDate', and 'goal' strings.
export const createSprintSchema = yup.object({ name: yup.string().required('Sprint name is required'), originBoardId: yup.number().required('Origin board ID is required'), startDate: yup.string().optional(), endDate: yup.string().optional(), goal: yup.string().optional(), }); - src/jira-client.ts:505-518 (helper)The JiraClient.createSprint() method that calls the underlying jira.js AgileClient.sprint.createSprint() API with name, originBoardId, startDate, endDate, and goal.
async createSprint(input: CreateSprintInput) { try { const response = await this.agileClient.sprint.createSprint({ name: input.name, originBoardId: input.originBoardId, startDate: input.startDate, endDate: input.endDate, goal: input.goal, }); return response; } catch (error) { throw new Error(`Failed to create sprint: ${error instanceof Error ? error.message : 'Unknown error'}`); } } - src/index.ts:96-106 (registration)Tool routing in the main MCP server: routes 'create_sprint' (via name.startsWith('create_sprint')) to handleSprintTool.
} else if ( name.startsWith('get_sprints') || name.startsWith('move_issue_to_sprint') || name.startsWith('get_sprint_issues') || name.startsWith('get_agile_boards') || name.startsWith('delete_sprint') || name.startsWith('create_sprint') || name.startsWith('update_sprint') || name.startsWith('close_sprint') ) { return await handleSprintTool(name, args || {}, this.jiraClient);