record_decision
Record architectural or technical decisions with reasoning and impact for project documentation and context preservation.
Instructions
Record an architectural or technical decision
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID | |
| decision | Yes | Decision made | |
| reasoning | Yes | Reasoning behind the decision | |
| impact | No | Expected impact of the decision |
Implementation Reference
- src/server.ts:332-359 (handler)MCP tool handler for 'record_decision' that calls ContextManager.recordDecision and formats the MCP response.async ({ projectId, decision, reasoning, impact }) => { try { await this.contextManager.recordDecision( projectId, decision, reasoning, impact ); return { content: [ { type: "text", text: "Decision recorded successfully", }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error recording decision: ${ error instanceof Error ? error.message : "Unknown error" }`, }, ], }; }
- src/server.ts:322-330 (schema)Input schema using Zod for validating tool parameters: projectId, decision, reasoning, impact.inputSchema: { projectId: z.string().describe("Project ID"), decision: z.string().describe("Decision made"), reasoning: z.string().describe("Reasoning behind the decision"), impact: z .string() .optional() .describe("Expected impact of the decision"), },
- src/server.ts:317-361 (registration)Registration of the 'record_decision' tool with the MCP server, including title, description, schema, and handler.this.server.registerTool( "record_decision", { title: "Record Decision", description: "Record an architectural or technical decision", inputSchema: { projectId: z.string().describe("Project ID"), decision: z.string().describe("Decision made"), reasoning: z.string().describe("Reasoning behind the decision"), impact: z .string() .optional() .describe("Expected impact of the decision"), }, }, async ({ projectId, decision, reasoning, impact }) => { try { await this.contextManager.recordDecision( projectId, decision, reasoning, impact ); return { content: [ { type: "text", text: "Decision recorded successfully", }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error recording decision: ${ error instanceof Error ? error.message : "Unknown error" }`, }, ], }; } } );
- Helper method in ContextManager that appends the decision to the project's decisions array and persists the project update.async recordDecision( projectId: string, decision: string, reasoning: string, impact?: string ): Promise<void> { const project = await this.store.getProject(projectId); if (!project) { throw new Error("Project not found"); } project.decisions.push({ id: uuidv4(), decision, reasoning, impact, timestamp: new Date().toISOString(), }); await this.store.updateProject(project); }