record_decision
Capture and log architectural or technical decisions within a project, including the decision details, reasoning, and expected impact, to maintain clarity and context for future reference.
Instructions
Record an architectural or technical decision
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| decision | Yes | Decision made | |
| impact | No | Expected impact of the decision | |
| projectId | Yes | Project ID | |
| reasoning | Yes | Reasoning behind the decision |
Implementation Reference
- src/server.ts:317-361 (registration)Registration of the 'record_decision' tool using this.server.registerTool, including inline schema and handler function.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" }`, }, ], }; } } );
- src/server.ts:332-360 (handler)The MCP tool handler logic for 'record_decision', which invokes the context manager's recordDecision method and returns formatted 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)Zod input schema for the 'record_decision' tool parameters.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"), },
- Core helper method that records the decision by appending to the project's decisions array and persisting via store.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); }
- src/types/project-types.ts:55-65 (schema)Zod schema definition for the decisions array in ProjectContext, matching the tool's data structure.decisions: z .array( z.object({ id: z.string(), decision: z.string(), reasoning: z.string(), timestamp: z.string(), impact: z.string().optional(), }) ) .default([]),