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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool lists templates grouped by type and language, which is basic behavioral info, but lacks details on permissions, rate limits, pagination, or response format. For a tool with no annotations, this is a significant gap in transparency about how it behaves beyond the core action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that clearly states the purpose without any wasted words. It's front-loaded with the core action and includes essential details (grouping by type and language). Every part of the sentence earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, no annotations, but has an output schema), the description is reasonably complete. It specifies what is listed and how it's grouped. With an output schema present, the description doesn't need to explain return values, so it covers the basics adequately, though it could benefit from more behavioral context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description adds no parameter info, which is appropriate here. Baseline for 0 parameters is 4, as it doesn't need to compensate for any gaps, and the description doesn't mislead about inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('templates'), specifying grouping by type and language. It distinguishes from siblings like 'get_best_practices' and 'get_style_guide' by focusing on templates rather than other content types. However, it doesn't explicitly mention what distinguishes it from potential template-related siblings (none listed here), so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for use, or compare to sibling tools like 'get_best_practices' or 'get_style_guide'. Usage is implied by the action of listing templates, but no explicit when/when-not instructions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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