create_handoff
Document completed work and project state to streamline handoffs. Capture codebase status, unresolved issues, and next steps for effective task transfer and workflow continuity.
Instructions
Complete a working session with handoff details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| codeState | Yes | Current state of codebase | |
| completedWork | Yes | Summary of completed work | |
| environmentState | Yes | Development environment state | |
| newNextSteps | No | List of new next steps identified | |
| projectId | Yes | Project identifier | |
| sessionId | Yes | Working session ID | |
| unresolvedIssues | No | List of unresolved issues |
Implementation Reference
- src/index.ts:206-242 (handler)Core implementation of the create_handoff tool logic in ProjectManager class. Validates template, loads project data, verifies session and step, updates statuses, creates and persists the new handoff.async createHandoff( projectId: string, sessionId: string, handoff: Omit<Handoff, 'id' | 'sessionId' | 'timestamp'> ): Promise<Handoff> { this.validateTemplate('handoff', handoff); const data = await this.loadProjectData(projectId); const session = data.workingSessions.find(s => s.id === sessionId); if (!session) { throw new ProjectError(`Session not found: ${sessionId}`, projectId); } if (session.endTime) { throw new ProjectError(`Session already ended: ${sessionId}`, projectId); } const step = data.nextSteps.find(s => s.id === session.nextStepId); if (!step) { throw new ProjectError(`Associated next step not found: ${session.nextStepId}`, projectId); } session.endTime = new Date().toISOString(); step.status = 'completed'; step.lastModified = new Date().toISOString(); const newHandoff: Handoff = { ...handoff, id: `handoff_${Date.now()}`, sessionId, timestamp: new Date().toISOString() }; data.handoffs.push(newHandoff); await this.saveProjectData(projectId, data); return newHandoff; }
- src/index.ts:358-382 (schema)Input schema definition for the create_handoff tool, registered in the listTools response.{ name: "create_handoff", description: "Complete a working session with handoff details", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "Project identifier" }, sessionId: { type: "string", description: "Working session ID" }, completedWork: { type: "string", description: "Summary of completed work" }, codeState: { type: "string", description: "Current state of codebase" }, environmentState: { type: "string", description: "Development environment state" }, unresolvedIssues: { type: "array", items: { type: "string" }, description: "List of unresolved issues" }, newNextSteps: { type: "array", items: { type: "string" }, description: "List of new next steps identified" } }, required: ["projectId", "sessionId", "completedWork", "codeState", "environmentState"] } },
- src/index.ts:480-497 (handler)MCP callTool request handler dispatch for create_handoff, which extracts arguments and calls the ProjectManager.createHandoff method.case "create_handoff": const handoff = await projectManager.createHandoff( args.projectId as string, args.sessionId as string, { completedWork: args.completedWork as string, codeState: args.codeState as string, environmentState: args.environmentState as string, unresolvedIssues: args.unresolvedIssues as string[] || [], newNextSteps: args.newNextSteps as string[] || [] } ); return { content: [{ type: "text", text: JSON.stringify(handoff, null, 2) }] };