get_best_practices
Retrieve application best practices in Markdown format for a specified programming language to improve code quality and adhere to coding standards.
Instructions
Get application best practices for the specified language in Markdown format
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | Yes |
Implementation Reference
- server.py:67-71 (handler)The handler function for the 'get_best_practices' tool, decorated with @mcp.tool() which also serves as registration. It generates the template filename and delegates to the read_template helper to fetch the Markdown content.@mcp.tool() def get_best_practices(language: str) -> str: """Get application best practices for the specified language in Markdown format""" filename = f"{language}_best_practices.md" return read_template(filename)
- server.py:21-30 (helper)Supporting utility function that reads the content of a template file from the 'templates' directory, providing error handling, and is called by the get_best_practices handler.def read_template(filename: str) -> str: """Read content from a template file""" template_path = os.path.join(os.path.dirname(__file__), "templates", filename) try: with open(template_path, "r") as f: return f.read() except FileNotFoundError: return f"Error: Template file {filename} not found" except Exception as e: return f"Error reading template {filename}: {str(e)}"