Skip to main content
Glama

get_ai_guidance

Provides structured guidance for MCP server development with deterministic recommendations and working code patterns based on specified topics.

Instructions

Get structured guidance for MCP server development.

IMPORTANT NOTES:
- AI sampling (ctx.sample) is NOT currently supported in Claude Desktop
- Use modern typing: dict, list, str | None instead of Dict, List, Optional
- Always implement proper process cleanup and signal handling
- Follow MCP SDK patterns for tools, resources, and prompts

This tool provides structured, deterministic guidance instead of AI-generated content.
For dynamic AI assistance, use Claude Desktop's built-in capabilities directly.

Args:
    topic: Topic to get guidance on (best_practices, security, performance, typing, etc.)
    server_type: Type of server for contextualized advice

Returns:
    Structured guidance and recommendations with working code patterns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYes
server_typeNogeneral

Implementation Reference

  • main.py:165-246 (handler)
    The handler function decorated with @mcp.tool(), implementing and registering the 'get_ai_guidance' tool. It returns hardcoded structured guidance for MCP server development topics.
    @mcp.tool()
    async def get_ai_guidance(
        ctx: Context,
        topic: str,
        server_type: str = "general",
    ) -> str:
        """
        Get structured guidance for MCP server development.
    
        IMPORTANT NOTES:
        - AI sampling (ctx.sample) is NOT currently supported in Claude Desktop
        - Use modern typing: dict, list, str | None instead of Dict, List, Optional
        - Always implement proper process cleanup and signal handling
        - Follow MCP SDK patterns for tools, resources, and prompts
    
        This tool provides structured, deterministic guidance instead of AI-generated content.
        For dynamic AI assistance, use Claude Desktop's built-in capabilities directly.
    
        Args:
            topic: Topic to get guidance on (best_practices, security, performance, typing, etc.)
            server_type: Type of server for contextualized advice
    
        Returns:
            Structured guidance and recommendations with working code patterns
        """
        try:
            guidance_prompt = f"""
            Provide comprehensive guidance for MCP server development on the topic: {topic}
            Context: Creating a {server_type} MCP server
    
            Please include:
            1. Key best practices
            2. Common pitfalls to avoid
            3. Security considerations
            4. Performance optimization tips
            5. Specific recommendations for this server type
    
            Format the response clearly with actionable advice.
            """
    
            # Note: AI sampling is not currently supported in Claude Desktop
            # Providing structured guidance template instead
            guidance = f"""
            ## MCP Server Development Guidance - {topic.title()}
    
            ### Best Practices for {server_type} servers:
            1. **Process Management**: Implement signal handlers and cleanup functions
            2. **Error Handling**: Use try/catch blocks with meaningful error messages
            3. **Security**: Validate all inputs and sanitize data
            4. **Performance**: Use async/await patterns and connection pooling
            5. **Logging**: Log to stderr for MCP compliance
    
            ### Common Pitfalls:
            - Missing process cleanup leading to resource leaks
            - Blocking operations without async/await
            - Inadequate input validation
            - Poor error messages that don't help debugging
    
            ### Security Considerations:
            - Always validate and sanitize user inputs
            - Implement rate limiting for resource-intensive operations
            - Use environment variables for sensitive configuration
            - Follow principle of least privilege
    
            ### Performance Tips:
            - Cache expensive operations when possible
            - Use connection pooling for databases
            - Implement proper timeouts
            - Monitor resource usage
    
            ### Specific Recommendations for {server_type}:
            - Follow existing patterns in the MCP-Creator templates
            - Test with small inputs before scaling
            - Implement graceful degradation for failures
            - Document your API clearly
            """
            return f"🧠 AI Guidance - {topic.title()}:\n\n{guidance}"
    
        except Exception as e:
            logger.error(f"Failed to get AI guidance for topic '{topic}': {e}")
            return f"❌ Error getting guidance: {str(e)}"
  • main.py:165-165 (registration)
    The @mcp.tool() decorator registers the get_ai_guidance function as an MCP tool.
    @mcp.tool()
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context: the tool is deterministic (not AI-generated), provides structured guidance with code patterns, and includes important notes on limitations (e.g., AI sampling not supported). However, it lacks details on permissions, rate limits, or error handling, which are important for a guidance tool.

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

Conciseness3/5

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

The description is appropriately sized but not optimally structured. It front-loads the purpose but includes a lengthy 'IMPORTANT NOTES' section that, while relevant, could be more integrated. The sentences earn their place, but the flow could be improved for better readability and focus on the tool's core function.

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

Completeness3/5

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

Given the tool's complexity (2 parameters, no output schema, no annotations), the description is moderately complete. It covers purpose, usage, and parameter semantics adequately but lacks details on output format (beyond 'structured guidance'), error cases, or examples. For a guidance tool with no output schema, more information on return values would be beneficial.

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 schema description coverage is 0%, so the description must compensate. It adds meaning by explaining 'topic' as 'Topic to get guidance on (best_practices, security, performance, typing, etc.)' and 'server_type' as 'Type of server for contextualized advice,' which clarifies their purposes beyond the schema's basic titles. However, it doesn't provide examples or constraints for these parameters.

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: 'Get structured guidance for MCP server development' and specifies it provides 'structured, deterministic guidance instead of AI-generated content.' This distinguishes it from AI-generated assistance but doesn't explicitly differentiate it from sibling tools like 'create_mcp_server' or 'list_templates' in terms of guidance vs. creation/listing functions.

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

Usage Guidelines4/5

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

The description provides clear context on when to use this tool: for 'structured, deterministic guidance' on MCP server development topics. It explicitly states 'For dynamic AI assistance, use Claude Desktop's built-in capabilities directly,' offering an alternative. However, it doesn't specify when NOT to use it relative to sibling tools like 'create_mcp_server' or 'save_workflow.'

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