Skip to main content
Glama

create_level

Design and generate playable 2D platformer levels for VibeTide with specified dimensions, tile layouts, and difficulty parameters to create engaging gameplay experiences.

Instructions

You are an AI assistant tasked with creating fast, fun, and playable levels for the VibeTide 2D platformer game. Your role is to design levels that are engaging and balanced while adhering to specific rules and guidelines.

Here are the critical rules you must follow:
1. Create levels that are EXACTLY target_width tiles wide and target_height tiles tall (default 50×22).
2. The player must spawn at the LEFTMOST solid platform in the bottom half of the level.
3. Leave 3-4 empty rows above the starting platform for jumping.
4. Design the level as a LEFT-TO-RIGHT platformer, not a maze.

Use the following tile types in your level design:
0 = Empty
1 = Grass
2 = Rock
3 = Yellow
4 = Ice
5 = Red
6 = Spikes
7 = Water

Follow these level design guidelines:
- Bottom half: Focus on main platforms and gameplay elements
- Top half: Keep mostly empty for air and jumping
- Create jumpable gaps (maximum 3-4 tiles apart)
- Ensure a clear left-to-right progression

For difficulty parameters:
- Easy levels: maxEnemies=2-3, enemySpawnChance=5-10, coinSpawnChance=20-30
- Medium levels: maxEnemies=4-6, enemySpawnChance=10-15, coinSpawnChance=15-20
- Hard levels: maxEnemies=7-10, enemySpawnChance=15-25, coinSpawnChance=10-15


Ensure that your level is exactly the specified dimensions and follows all the design rules for playability.

Args:
    level_name: The name of the level
    description: A brief description of the level
    tiles: A 2D array of tile types
    width: The width of the level
    height: The height of the level
    maxEnemies: The maximum number of enemies in the level
    enemySpawnChance: The chance of an enemy spawning
    coinSpawnChance: The chance of a coin spawning

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
level_nameYes
descriptionYes
tilesYes
widthNo
heightNo
maxEnemiesNo
enemySpawnChanceNo
coinSpawnChanceNo

Implementation Reference

  • The core handler function for the 'create_level' MCP tool. Decorated with @mcp.tool() for registration. Takes level parameters including name, description, tiles grid, dimensions, and spawn chances; constructs level_data dict; encodes it using level_encoder; generates play URL; returns success response with data or error.
    @mcp.tool()
    async def create_level(
        level_name: str,
        description: str,
        tiles: List[List[int]],
        width: int = 50,
        height: int = 22,
        maxEnemies: int = 5,
        enemySpawnChance: float = 10.0,
        coinSpawnChance: float = 15.0,
    ) -> Dict[str, Any]:
        """You are an AI assistant tasked with creating fast, fun, and playable levels for the VibeTide 2D platformer game. Your role is to design levels that are engaging and balanced while adhering to specific rules and guidelines.
    
        Here are the critical rules you must follow:
        1. Create levels that are EXACTLY target_width tiles wide and target_height tiles tall (default 50×22).
        2. The player must spawn at the LEFTMOST solid platform in the bottom half of the level.
        3. Leave 3-4 empty rows above the starting platform for jumping.
        4. Design the level as a LEFT-TO-RIGHT platformer, not a maze.
    
        Use the following tile types in your level design:
        0 = Empty
        1 = Grass
        2 = Rock
        3 = Yellow
        4 = Ice
        5 = Red
        6 = Spikes
        7 = Water
    
        Follow these level design guidelines:
        - Bottom half: Focus on main platforms and gameplay elements
        - Top half: Keep mostly empty for air and jumping
        - Create jumpable gaps (maximum 3-4 tiles apart)
        - Ensure a clear left-to-right progression
    
        For difficulty parameters:
        - Easy levels: maxEnemies=2-3, enemySpawnChance=5-10, coinSpawnChance=20-30
        - Medium levels: maxEnemies=4-6, enemySpawnChance=10-15, coinSpawnChance=15-20
        - Hard levels: maxEnemies=7-10, enemySpawnChance=15-25, coinSpawnChance=10-15
    
    
        Ensure that your level is exactly the specified dimensions and follows all the design rules for playability.
    
        Args:
            level_name: The name of the level
            description: A brief description of the level
            tiles: A 2D array of tile types
            width: The width of the level
            height: The height of the level
            maxEnemies: The maximum number of enemies in the level
            enemySpawnChance: The chance of an enemy spawning
            coinSpawnChance: The chance of a coin spawning
        """
        try:
    
            # Create the level data dictionary
            level_data = {
                "name": level_name,
                "description": description,
                "tiles": tiles,
                "width": width,
                "height": height,
                "maxEnemies": maxEnemies,
                "enemySpawnChance": enemySpawnChance,
                "coinSpawnChance": coinSpawnChance,
            }
    
            # Pass the complete level_data dictionary to the encoder
            encoded_level = level_encoder.encode(level_data)
            play_url = f"{VIBE_TIDE_CONFIG['web_player_url']}?level={encoded_level}"
    
            return {
                "success": True,
                "level_data": level_data,
                "encoded_level": encoded_level,
                "play_url": play_url,
                "message": f"Successfully created level '{level_name}'",
            }
    
        except Exception as e:
            logger.error(f"Failed to create level with AI: {e}")
            return {"success": False, "error": f"Failed to create level with AI: {str(e)}"}

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/banjtheman/vibe_tide_mcp'

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