Skip to main content
Glama
Njengah
by Njengah

suggest_improvements

Analyze documentation to identify gaps and suggest improvements, including templates for missing content and enhancements for incomplete sections.

Instructions

Analyze existing documentation and suggest improvements, including templates for missing docs and enhancements for incomplete documentation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to file or directory to analyze
limitNoMaximum number of suggestions to return

Implementation Reference

  • The core handler function for the 'suggest_improvements' tool. Analyzes the codebase path, generates improvement suggestions for documentation using analyzer and suggester, sorts by severity, applies limit, and returns structured results with error handling.
    export async function suggestImprovements(input: SuggestImprovementsInput) {
      try {
        const analyzer = new CodebaseAnalyzer();
        const results = await analyzer.analyzePath(input.path);
    
        if (results.length === 0) {
          return {
            success: false,
            error: 'No supported source files found in the specified path'
          };
        }
    
        const suggester = new ImprovementSuggester();
        const allSuggestions = suggester.generateSuggestions(results);
    
        // Sort by severity and take top N
        const sorted = allSuggestions.sort((a, b) => {
          const severityWeight = { critical: 3, medium: 2, low: 1 };
          return severityWeight[b.severity] - severityWeight[a.severity];
        });
    
        const limited = sorted.slice(0, input.limit);
    
        return {
          success: true,
          totalSuggestions: allSuggestions.length,
          returned: limited.length,
          suggestions: limited.map(s => ({
            file: s.element.filePath,
            line: s.element.line,
            type: s.element.type,
            name: s.element.name,
            severity: s.severity,
            reason: s.reason,
            currentDoc: s.currentDoc,
            suggestedDoc: s.suggestedDoc,
            signature: s.element.signature
          }))
        };
      } catch (error) {
        return {
          success: false,
          error: (error as Error).message
        };
      }
    }
  • Zod input schema for the tool defining 'path' (string) and 'limit' (number, 1-100, default 20).
    export const SuggestImprovementsSchema = z.object({
      path: z.string().describe('Path to file or directory to analyze'),
      limit: z.number().min(1).max(100).default(20).describe('Maximum number of suggestions to return')
    });
  • src/index.ts:62-66 (registration)
    Tool registration in the TOOLS array used by the MCP server, specifying name, description, and input schema.
    {
      name: 'suggest_improvements',
      description: 'Analyze existing documentation and suggest improvements, including templates for missing docs and enhancements for incomplete documentation.',
      inputSchema: SuggestImprovementsSchema
    }
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. It mentions analyzing and suggesting improvements but lacks details on permissions needed, whether it modifies files, rate limits, or output format. For a tool that likely involves reading and processing documentation, this gap is significant, though not contradictory.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose. It avoids unnecessary words and gets straight to the point. However, it could be slightly more structured by separating the analysis and suggestion components for clarity, but it's still highly concise.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on behavior, output, or integration with siblings. Without annotations or output schema, more context on what 'suggestions' entail would improve completeness, but it meets a basic threshold.

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 both parameters ('path' and 'limit'). The description does not add any meaning beyond what the schema provides, such as explaining what types of files are analyzed or how suggestions are prioritized. With high schema coverage, the baseline score of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Analyze existing documentation and suggest improvements' with specific actions like 'including templates for missing docs and enhancements for incomplete documentation.' It uses specific verbs (analyze, suggest) and identifies the resource (documentation). However, it doesn't explicitly differentiate from sibling tools like 'detect_missing_docs' or 'generate_documentation,' which prevents a perfect score.

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 the sibling tools 'analyze_codebase,' 'detect_missing_docs,' or 'generate_documentation.' There are no explicit instructions on prerequisites, alternatives, or exclusions. The tool's purpose is clear, but usage context is missing, leaving the agent to infer when this is the appropriate choice.

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/Njengah/claude-4.5-mcp-tutorial'

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