check_readability
Analyze readability metrics for manuscripts to assess text complexity and improve writing clarity.
Instructions
Analyze readability metrics
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "check_readability"
}
}Input 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.analyzeReadability
private 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 dispatcher
case "check_readability": return this.checkReadability(args); - Core readability analysis implementation that loads files, calculates metrics using helper methods
async 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 ReadabilityAnalyzer
async analyzeReadability(filePath?: string) { return this.readabilityAnalyzer.analyzeReadability(filePath); }