Skip to main content
Glama

detect_missing_docs

Identify undocumented code elements in TypeScript, JavaScript, or Python files and categorize them by severity level to prioritize documentation efforts.

Instructions

Detect code elements that are missing documentation and categorize them by severity (critical, medium, low).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to file or directory to analyze
minSeverityNoMinimum severity level to report

Implementation Reference

  • The primary handler function for the 'detect_missing_docs' tool. Analyzes the specified path using CodebaseAnalyzer, detects missing documentation with DocDetector, applies severity filtering, generates a summary, and returns structured results with success status and details.
    export async function detectMissingDocs(input: DetectMissingDocsInput) { 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 detector = new DocDetector(); const allMissing = detector.detectMissingDocs(results); // Filter by severity const severityOrder = { critical: 3, medium: 2, low: 1 }; const minLevel = severityOrder[input.minSeverity as keyof typeof severityOrder]; const filtered = allMissing.filter(m => severityOrder[m.severity as keyof typeof severityOrder] >= minLevel ); const summary = detector.getSummary(allMissing); return { success: true, summary: { total: allMissing.length, filtered: filtered.length, bySeverity: summary.bySeverity, byType: summary.byType }, missing: filtered.map(m => ({ file: m.element.filePath, line: m.element.line, type: m.element.type, name: m.element.name, severity: m.severity, reason: m.reason, signature: m.element.signature })) }; } catch (error) { return { success: false, error: (error as Error).message }; } }
  • Zod schema defining the input for the 'detect_missing_docs' tool: path to analyze and optional minimum severity threshold.
    export const DetectMissingDocsSchema = z.object({ path: z.string().describe('Path to file or directory to analyze'), minSeverity: z.enum(['critical', 'medium', 'low']).default('low').describe('Minimum severity level to report') });
  • src/index.ts:58-61 (registration)
    Tool registration in the TOOLS array used for listing available tools, specifying name, description, and input schema.
    name: 'detect_missing_docs', description: 'Detect code elements that are missing documentation and categorize them by severity (critical, medium, low).', inputSchema: DetectMissingDocsSchema },
  • src/index.ts:121-132 (registration)
    Dispatch handler in the CallToolRequest switch statement that validates input, calls the detectMissingDocs function, and formats the response.
    case 'detect_missing_docs': { const validated = DetectMissingDocsSchema.parse(args); const result = await detectMissingDocs(validated); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
  • Core helper method in DocDetector class that scans analysis results for undocumented code elements, assigns severity and reasons, and sorts by priority.
    detectMissingDocs(results: AnalysisResult[]): MissingDocumentation[] { const missing: MissingDocumentation[] = []; for (const result of results) { for (const element of result.elements) { if (!element.hasDocumentation) { missing.push({ element, severity: this.determineSeverity(element), reason: this.getReason(element) }); } } } return missing.sort((a, b) => this.severityWeight(b.severity) - this.severityWeight(a.severity)); }

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