get_best_practices
Retrieve coding best practices and style guidelines for specific programming languages in Markdown format to improve code quality and maintainability.
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:68-71 (handler)Handler function that takes a language parameter, constructs the corresponding best practices template filename, and returns its content by calling the read_template helper.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:67-67 (registration)Registers the get_best_practices function as an MCP tool using the @mcp.tool() decorator.@mcp.tool()
- server.py:21-30 (helper)Helper function used by the handler to read the content of a template file from the templates directory, handling errors appropriately.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)}"