check_readability
Analyze readability metrics for manuscripts to assess text complexity and improve writing clarity.
Instructions
Analyze readability metrics
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | Path to manuscript directory (defaults to current directory) | |
| file_path | No | Specific file to analyze | |
| metrics | No | Metrics to calculate |
Implementation Reference
- src/tools/WriterToolHandlers.ts:271-275 (handler)Handler function that extracts file_path from args and delegates to WritersAid.analyzeReadabilityprivate async checkReadability(args: Record<string, unknown>) { const filePath = args.file_path as string | undefined; return this.writersAid.analyzeReadability(filePath); }
- Input schema definition for the check_readability tool{ name: "check_readability", description: "Analyze readability metrics", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" }, file_path: { type: "string", description: "Specific file to analyze" }, metrics: { type: "array", items: { type: "string" }, description: "Metrics to calculate", }, }, }, },
- src/tools/WriterToolHandlers.ts:50-51 (registration)Tool name registration in the handleTool switch statement dispatchercase "check_readability": return this.checkReadability(args);
- Core readability analysis implementation that loads files, calculates metrics using helper methodsasync analyzeReadability(filePath?: string): Promise<ReadabilityMetrics[]> { const files = filePath ? [await this.storage.getFile(filePath)] : await this.storage.getAllFiles(); const validFiles = files.filter((f) => f !== null); const results: ReadabilityMetrics[] = []; for (const file of validFiles) { const metrics = this.calculateMetrics(file.content, file.file_path); results.push(metrics); } return results; }
- src/WritersAid.ts:218-220 (helper)Delegation method in WritersAid that forwards to ReadabilityAnalyzerasync analyzeReadability(filePath?: string) { return this.readabilityAnalyzer.analyzeReadability(filePath); }