Skip to main content
Glama

list_templates

Browse available templates for creating MCP servers, optionally filtered by programming language, to accelerate development with pre-configured starting points.

Instructions

list available templates for MCP server creation.

Args:
    language: Filter by language (optional)

Returns:
    Formatted list of available templates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNo

Implementation Reference

  • main.py:133-162 (handler)
    The main MCP tool handler for 'list_templates', including registration via @mcp.tool() decorator. This function fetches templates from the template_manager and formats them for output.
    @mcp.tool()
    async def list_templates(ctx: Context, language: str | None = None) -> str:
        """
        list available templates for MCP server creation.
    
        Args:
            language: Filter by language (optional)
    
        Returns:
            Formatted list of available templates
        """
        try:
            template_manager = ctx.request_context.lifespan_context["template_manager"]
            templates = await template_manager.list_templates(language=language)
    
            if not templates:
                return "No templates available"
    
            result = "đź“‹ Available Templates:\n\n"
            for lang, template_list in templates.items():
                result += f"**{lang.upper()}:**\n"
                for template in template_list:
                    result += f"  • {template['name']}: {template['description']}\n"
                result += "\n"
    
            return result
    
        except Exception as e:
            logger.error(f"Failed to list templates: {e}")
            return f"❌ Error listing templates: {str(e)}"
  • Core helper method in TemplateManager that performs the actual template listing and filtering by language, returning a structured dictionary of templates.
    async def list_templates(self, language: str | None = None) -> dict[str, list[dict]]:
        """list templates with optional language filtering."""
        result = {}
    
        for template in self.templates.values():
            if language and template.language != language:
                continue
    
            lang = template.language
            if lang not in result:
                result[lang] = []
    
            result[lang].append({
                "name": template.name,
                "description": template.description,
                "features": template.features,
            })
    
        return result
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 of behavioral disclosure. It states the tool lists templates and returns a formatted list, but it doesn't cover important aspects like whether this is a read-only operation, potential side effects, error handling, or performance considerations. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness4/5

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

The description is concise and well-structured, with a clear purpose statement followed by brief sections for arguments and returns. It avoids unnecessary words and is front-loaded with the main functionality. However, it could be slightly more efficient by integrating the optional note into the purpose statement.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It covers the basic purpose and parameter but misses behavioral details, usage context, and output specifics. For a tool with no structured support, the description should provide more comprehensive guidance to be fully helpful to an agent.

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

Parameters3/5

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

The description adds some value beyond the input schema by explaining that the 'language' parameter is optional and used for filtering. However, with 0% schema description coverage and only one parameter, the description doesn't fully compensate—it lacks details on format, constraints, or examples. Since there's only one parameter, the baseline is higher, but the information provided is minimal.

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 tool's purpose: 'list available templates for MCP server creation.' This specifies the verb ('list'), resource ('templates'), and context ('for MCP server creation'), making it easy to understand what the tool does. However, it doesn't explicitly distinguish this tool from its siblings (e.g., create_mcp_server, get_ai_guidance, save_workflow), which would be needed for a score of 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 minimal usage guidance. It mentions an optional 'language' filter but doesn't explain when to use this tool versus alternatives like create_mcp_server or other siblings. There's no context on prerequisites, typical scenarios, or exclusions, leaving the agent with little direction on appropriate usage.

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/angrysky56/mcp-creator-mcp'

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