Overview
Theget_undocumented tool identifies all environment variables that are used in code but not documented in .env.example files. It provides usage context and suggested descriptions to help document each variable.
Parameters
Path to the project directory. Defaults to current working directory.
Response
Array of undocumented environment variables
Total number of undocumented variables
Whether the project has any .env.example files
Scan metadata
Example Response
Usage Example
AI assistants can use this tool to identify undocumented variables:Description Suggestions
The tool automatically generates description suggestions based on:Known Patterns
Common variables get standard descriptions:DATABASE_URL→ “Database connection string”API_KEY→ “API key for external service”JWT_SECRET→ “Secret key for JWT token signing”PORT→ “Server port number”NODE_ENV→ “Node.js environment (development/production)“
Service Prefixes
Variables with known service prefixes:AWS_*→ “AWS service configuration”STRIPE_*→ “Stripe payment configuration”SENDGRID_*→ “SendGrid email service configuration”SENTRY_*→ “Sentry error tracking configuration”
Suffix Analysis
Common suffixes get context-appropriate descriptions:*_URL→ “URL endpoint for [name]”*_HOST→ “Host address for [name]”*_PORT→ “Port number for [name]”*_KEY→ “API/access key for [name]”*_SECRET→ “Secret key for [name]”*_TOKEN→ “Authentication token for [name]“
Name-Based Generation
For other variables, descriptions are generated from the variable name:EMAIL_FROM→ “Configuration for email from”MAX_RETRIES→ “Configuration for max retries”
Secret Detection
TheisSecret field indicates if the variable likely contains sensitive data. It’s marked as true if the name matches:
*SECRET**PASSWORD**TOKEN**_KEY(ending with _KEY)*API_KEY**PRIVATE*
Usage Context
TheusageContext field shows the first occurrence of the variable in code, helping understand:
- How the variable is accessed (process.env, import.meta.env, etc.)
- Whether it has a default/fallback value
- What the variable is used for
Use Cases
- Documentation: Automatically generate entries for .env.example
- Onboarding: Help new developers understand all required configuration
- Security Audit: Identify undocumented secrets that should be tracked
- Maintenance: Keep .env.example in sync with actual code usage
- Code Review: Ensure new variables are properly documented
Workflow
- Call
get_undocumentedto find all undocumented variables - Review the suggested descriptions and usage context
- Add variables to .env.example with appropriate descriptions
- Mark secrets with clear warnings
- Provide example values or placeholder text
- Re-run to verify all variables are now documented