list_writing_decisions
Retrieve and filter writing decisions from markdown manuscripts by file, type, or date range to track editorial choices and maintain consistency.
Instructions
List writing decisions by file, type, or date range
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | Path to manuscript directory (defaults to current directory) | |
| file_path | No | Filter decisions for this file | |
| decision_type | No | Filter by decision type | |
| limit | No | Maximum decisions to return |
Implementation Reference
- src/WritersAid.ts:395-433 (handler)Core handler implementation that queries the DecisionExtractor for writing decisions filtered by file, type, or defaults to recent structure decisions, then maps and returns formatted results.async listWritingDecisions(options: { filePath?: string; decisionType?: "structure" | "content" | "terminology" | "style"; limit?: number; }) { let decisions; if (options.filePath) { decisions = this.decisionExtractor.getDecisionsByFile( options.filePath, options.limit || 20 ); } else if (options.decisionType) { decisions = this.decisionExtractor.getDecisionsByType( options.decisionType, options.limit || 20 ); } else { // Get all recent decisions decisions = this.decisionExtractor.getDecisionsByType( "structure", options.limit || 20 ); } return { decisions: decisions.map((decision) => ({ id: decision.id, decisionText: decision.decisionText, rationale: decision.rationale, decisionType: decision.decisionType, filePath: decision.filePath, section: decision.section, timestamp: new Date(decision.timestamp).toISOString(), alternativesConsidered: decision.alternativesConsidered, })), total: decisions.length, }; }
- src/tools/WriterToolHandlers.ts:353-368 (handler)Intermediate handler that parses tool arguments (file_path, decision_type, limit) and delegates execution to WritersAid.listWritingDecisions.private async listWritingDecisions(args: Record<string, unknown>) { const filePath = args.file_path as string | undefined; const decisionType = args.decision_type as | "structure" | "content" | "terminology" | "style" | undefined; const limit = (args.limit as number) || 20; return this.writersAid.listWritingDecisions({ filePath, decisionType, limit, }); }
- src/tools/WriterToolHandlers.ts:68-69 (registration)Dispatch case in the central handleTool switch statement that routes calls to the listWritingDecisions handler method.case "list_writing_decisions": return this.listWritingDecisions(args);
- MCP tool schema definition specifying input parameters, types, descriptions, and defaults for validation.{ name: "list_writing_decisions", description: "List writing decisions by file, type, or date range", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" }, file_path: { type: "string", description: "Filter decisions for this file" }, decision_type: { type: "string", enum: ["structure", "content", "terminology", "style"], description: "Filter by decision type", }, limit: { type: "number", description: "Maximum decisions to return", default: 20 }, }, }, },