Skip to main content
Glama
code4mk

Cox's Bazar AI Itinerary MCP Server

cox_ai_itinerary

Generate AI-powered travel itineraries for Cox's Bazar using weather data and trip duration to create personalized daily plans for your Bangladesh vacation.

Instructions

Full workflow: fetch daily temperatures + generate AI itinerary. Uses the registered MCP prompt 'generate_itinerary' for consistency.

Args: days: Number of days for the trip start_date: Start date (e.g., "2025-01-15", "15 Jan 2025", "today")

Returns: Formatted prompt for AI to generate detailed itinerary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysYes
start_dateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Registration of the 'cox_ai_itinerary' tool using the @mcp.tool decorator, specifying name and description.
    @mcp.tool(
        name="cox_ai_itinerary",
        description="generate itinerary for coxs bazar",
    )
  • The core handler function for the 'cox_ai_itinerary' tool. It elicits trip extensions, fetches weather forecast for Cox's Bazar, generates prompts for itinerary and weather-based activities, and formats a comprehensive output including trip details, daily weather, activity suggestions, and AI prompts.
    async def cox_ai_itinerary(ctx: Context, start_date: str, days: int, ) -> str:
        """
        Full workflow: fetch daily temperatures + generate AI itinerary.
        Uses the registered MCP prompt 'generate_itinerary' for consistency.
        
        Args:
            days: Number of days for the trip
            start_date: Start date (e.g., "2025-01-15", "15 Jan 2025", "today")
        
        Returns:
            Formatted prompt for AI to generate detailed itinerary
        """
        
        # Elicit trip extension if needed (minimum 2 days recommended)
        try:
            days, elicitation_note = await elicit_trip_extension(ctx, start_date, days, min_days=2)
        except ValueError as e:
            # User cancelled the trip extension
            await ctx.error(f"Error: {str(e)}")
            return str(e)
        
        # Parse start date
        try:
            start_date = parser.parse(start_date)
        except Exception:
            start_date = datetime.today()
    
        # Get weather forecast
        read_weather_forecast = await ctx.read_resource(f"weather://coxsbazar/forecast/{start_date.strftime('%Y-%m-%d')}/{days}")
        weather_data = json.loads(read_weather_forecast[0].content)
        
        # Generate base itinerary prompt
        base_prompt = await get_itinerary_prompt(days, start_date)
        
        # Generate weather-based activities prompt
        weather_prompt = await get_weather_based_activities_prompt(weather_data)
        
        # Format output
        output = f"""# Cox's Bazar Itinerary Planning
    
    ## Trip Details
    - **Location:** {weather_data['location']}
    - **Start Date:** {weather_data['start_date']}
    - **Duration:** {days} day(s)
    - **Timezone:** {weather_data['timezone']}
    
    ## Weather Forecast
    
    """
        
        # Add detailed forecast
        for day in weather_data['forecast']:
            output += f"""### Day {day['day']} - {day['date']}
    - **Weather:** {day['weather']}
    - **Temperature:** {day['temp_min']}°C - {day['temp_max']}°C (Average: {day['temp_avg']}°C)
    - **Precipitation:** {day['precipitation']}mm
    - **Wind Speed:** {day['windspeed']} km/h
    - **Sunrise:** {day['sunrise']} | **Sunset:** {day['sunset']}
    
    **Activity Suggestions:**
    """
            
            # Get activity suggestions for different times
            temp_avg = day['temp_avg']
            morning_activities = get_suggestions(temp_avg - 2, "morning")
            afternoon_activities = get_suggestions(temp_avg, "afternoon")
            evening_activities = get_suggestions(temp_avg, "evening")
            
            output += f"""
    - **Morning:** {', '.join(morning_activities[:2])}
    - **Afternoon:** {', '.join(afternoon_activities[:2])}
    - **Evening:** {', '.join(evening_activities[:2])}
    
    {elicitation_note}
    
    """
        
        output += f"""
    ---
    
    ## AI Itinerary Generation Prompt
    
    {base_prompt}
    
    ---
    
    ## Weather-Based Activities Prompt
    
    {weather_prompt}
    
    ---
    
    **Note:** Use the above prompts with an AI assistant to generate a detailed, personalized itinerary based on the weather forecast and your preferences.
    """
        
        return output
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the tool's workflow and mentions using a registered prompt for consistency, which adds useful context. However, it doesn't cover important behavioral aspects like error handling, rate limits, authentication needs, or what happens if temperature data is unavailable. The description doesn't contradict any annotations since none exist.

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 well-structured with clear sections: workflow overview, args, and returns. Each sentence adds value, though the 'Full workflow' line could be more concise. The bullet-point format for args and returns is efficient. It's appropriately sized for a 2-parameter tool with a specific workflow.

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 moderate complexity (2 parameters, workflow involving external data fetch and AI generation), no annotations, but with an output schema (implied by 'Returns' section), the description is reasonably complete. It explains the purpose, parameters, and output format. The main gap is lack of error handling or edge case guidance, but the output schema reduces the need to fully document return values.

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?

Schema description coverage is 0%, so the description must compensate. It provides clear semantic meaning for both parameters: 'days' as 'Number of days for the trip' and 'start_date' with format examples. This adds significant value beyond the bare schema, though it doesn't explain constraints like date ranges or day limits. With 0% schema coverage and 2 parameters, this is strong but not perfect compensation.

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: 'fetch daily temperatures + generate AI itinerary' and mentions using a registered MCP prompt. It distinguishes from the sibling 'get_activity_suggestions' by focusing on full itinerary generation rather than just suggestions. However, it doesn't specify the exact resource being fetched (e.g., temperatures for what location?), making it slightly less specific than 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 Guidelines3/5

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

The description implies usage for trip planning with temperature data, but doesn't explicitly state when to use this tool versus alternatives like 'get_activity_suggestions'. It mentions the workflow but lacks clear guidance on prerequisites or exclusions (e.g., whether location data is needed elsewhere).

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/code4mk/mcp-boilerplate'

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