Skip to main content
Glama

get_writing_stats

Analyze writing projects to track progress, check quality, and maintain consistency across chapters, dates, or tags in markdown manuscripts.

Instructions

Overall project statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
scopeNoFile scope pattern
breakdown_byNoBreakdown method

Implementation Reference

  • MCP tool handler function for 'get_writing_stats' that extracts scope from input args and delegates to WritersAid.getStats method.
    private async getWritingStats(args: Record<string, unknown>) {
      const scope = args.scope as string | undefined;
    
      return this.writersAid.getStats({ scope });
    }
  • Core helper method in WritersAid that computes project writing statistics by querying storage for all files and aggregating word counts, file counts, averages, and per-file details.
    async getStats(_options?: { scope?: string }) {
      const files = await this.storage.getAllFiles();
      const totalWords = files.reduce((sum, f) => sum + (f.word_count || 0), 0);
      const totalFiles = files.length;
    
      return {
        totalWords,
        totalFiles,
        averageWordsPerFile: totalFiles > 0 ? Math.round(totalWords / totalFiles) : 0,
        files: files.map((f) => ({
          path: f.file_path,
          words: f.word_count || 0,
          lastModified: f.last_modified,
        })),
      };
    }
  • JSON schema definition for the get_writing_stats tool, including input properties and descriptions.
    {
      name: "get_writing_stats",
      description: "Overall project statistics",
      inputSchema: {
        type: "object",
        properties: {
          project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
          scope: { type: "string", description: "File scope pattern" },
          breakdown_by: {
            type: "string",
            enum: ["chapter", "date", "tag"],
            description: "Breakdown method",
          },
        },
      },
    },
  • src/index.ts:73-75 (registration)
    MCP server registration for listing available tools, which includes the get_writing_stats tool schema from writerToolDefinitions.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: writerToolDefinitions,
    }));
  • src/index.ts:86-91 (registration)
    MCP server tool call handler registration that instantiates WritersAid and WriterToolHandlers, then dispatches to the specific tool handler via handleTool.
    const writersAid = new WritersAid({ projectPath });
    const handlers = new WriterToolHandlers(writersAid);
    
    // Call the tool
    const result = await handlers.handleTool(name, args || {});
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Overall project statistics' implies a read-only operation that aggregates data, but it doesn't specify whether this requires file access permissions, what format the statistics are returned in, or if there are any rate limits or performance considerations. The description is too brief to provide meaningful behavioral context beyond the basic purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just three words, front-loaded with the core purpose. There is zero wasted language or redundancy. While it may be under-specified, it earns full marks for conciseness as every word ('Overall', 'project', 'statistics') contributes directly to the tool's intent without fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (3 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what statistics are returned, how they're formatted, or any behavioral traits. While the schema covers parameters, the lack of output schema means the description should ideally hint at return values, but it doesn't. This leaves significant gaps for an AI agent to understand the tool's full context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters (project_path, scope, breakdown_by) with descriptions and an enum for breakdown_by. The description adds no additional meaning beyond what's in the schema—it doesn't explain how parameters interact or provide examples. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Overall project statistics' states what the tool provides (statistics) but is vague about the specific resource and verb. It mentions 'project' which aligns with the 'project_path' parameter, but doesn't specify what kind of statistics (e.g., word count, writing metrics) or how they relate to writing/manuscripts. It distinguishes from siblings by focusing on statistics rather than analysis or editing, but lacks precision.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, context for usage, or comparisons to sibling tools like 'generate_progress_report' or 'track_changes' that might offer related functionality. The agent must infer usage from the name and parameters alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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