Skip to main content
Glama
ggerve

Coding Standards MCP Server

by ggerve

list_templates

Browse available coding templates by type and language to implement style guidelines and best practices for Java, Python, React, and other technologies.

Instructions

List all available templates grouped by type and language

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:32-58 (handler)
    The handler function for the 'list_templates' tool. It scans the templates directory, categorizes Markdown files using get_template_info, groups them by type (style_guides, best_practices) and language, sorts the lists, and returns the structured dictionary or an error.
    @mcp.tool() def list_templates() -> Dict[str, Dict[str, List[str]]]: """List all available templates grouped by type and language""" template_dir = os.path.join(os.path.dirname(__file__), "templates") templates = { "style_guides": {"languages": [], "files": []}, "best_practices": {"languages": [], "files": []} } try: for filename in os.listdir(template_dir): if filename.endswith('.md'): template_info = get_template_info(filename) if template_info: template_type = template_info["type"] templates[template_type]["languages"].append(template_info["language"]) templates[template_type]["files"].append(filename) # Sort the lists for consistent output for template_type in templates: templates[template_type]["languages"].sort() templates[template_type]["files"].sort() return templates except Exception as e: return {"error": f"Failed to list templates: {str(e)}"}
  • Helper function used by list_templates to parse filename and determine language and template type (style_guides or best_practices) using a regex pattern.
    def get_template_info(filename: str) -> Optional[Dict[str, str]]: """Extract template type and language from filename""" pattern = r"^(\w+)_(style_guide|best_practices)\.md$" match = re.match(pattern, filename) if match: language, template_type = match.groups() return { "language": language, "type": "style_guides" if template_type == "style_guide" else "best_practices" } return None

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/ggerve/coding-standards-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server