Skip to main content
Glama
xiaolai
by xiaolai

check_readability

Analyze readability metrics for manuscripts to assess text complexity and improve writing clarity.

Instructions

Analyze readability metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
file_pathNoSpecific file to analyze
metricsNoMetrics to calculate

Implementation Reference

  • 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",
          },
        },
      },
    },
  • 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;
    }
  • Delegation method in WritersAid that forwards to ReadabilityAnalyzer
    async analyzeReadability(filePath?: string) {
      return this.readabilityAnalyzer.analyzeReadability(filePath);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xiaolai/claude-writers-aid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server