get_style_guide
Retrieve Markdown-formatted coding style guidelines for a specified programming language to ensure adherence to best practices and standards.
Instructions
Get coding style guidelines for the specified language in Markdown format
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | Yes |
Implementation Reference
- server.py:60-65 (handler)The handler function for the 'get_style_guide' tool. Decorated with @mcp.tool() which also serves as registration. It generates the template filename based on the input language and returns the content by calling the read_template helper.@mcp.tool() def get_style_guide(language: str) -> str: """Get coding style guidelines for the specified language in Markdown format""" filename = f"{language}_style_guide.md" return read_template(filename)
- server.py:21-30 (helper)Helper utility function used by get_style_guide to read and return the content of the specified template file from the templates directory.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)}"