Skip to main content
Glama

liara_create_app

Create and deploy a new application on the Liara cloud platform by specifying name, platform type, and plan ID.

Instructions

Create a new app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesApp name (3-32 chars, lowercase, alphanumeric with hyphens)
platformYesPlatform type
planIDYesPlan ID for the app
regionNoDeployment region (optional)

Implementation Reference

  • The main handler function that implements the logic for creating a new Liara app/project. It validates inputs and calls the Liara API to create the project.
    export async function createApp(
        client: LiaraClient,
        request: CreateProjectRequest
    ): Promise<Project> {
        validateAppName(request.name);
        validateRequired(request.platform, 'Platform');
        validateRequired(request.planID, 'Plan ID');
        // Network is optional in schema but will be passed to API if provided
        // API will return error if network is required but not provided
    
        return await client.post<Project>('/v1/projects', request);
    }
  • Type definition for the input parameters to the createApp handler, defining the required fields like name, platform, and planID.
    export interface CreateProjectRequest {
        name: string;
        platform: Platform;
        planID: string;
        bundlePlanID?: string;
        region?: string;
        network?: string;
    }
  • Helper function to validate the app name format used in createApp.
    export function validateAppName(name: string): void {
        validateRequired(name, 'App name');
    
        if (name.length < 3) {
            throw new LiaraMcpError(
                `App name "${name}" is too short (minimum 3 characters, got ${name.length})`,
                'INVALID_APP_NAME',
                { name, length: name.length },
                ['Use a name like "my-app" or "api-service"']
            );
        }
    
        if (name.length > 32) {
            throw new LiaraMcpError(
                `App name "${name}" is too long (maximum 32 characters, got ${name.length})`,
                'INVALID_APP_NAME',
                { name, length: name.length },
                ['Shorten the name to 32 characters or less']
            );
        }
    
        if (!/^[a-z0-9-]+$/.test(name)) {
            const invalidChars = name.match(/[^a-z0-9-]/g);
            throw new LiaraMcpError(
                `App name contains invalid characters: ${invalidChars?.join(', ') || 'unknown'}`,
                'INVALID_APP_NAME',
                { name, invalidChars },
                ['Use only lowercase letters, numbers, and hyphens', 'Example: "my-app" or "api-service"']
            );
        }
    
        if (name.startsWith('-') || name.endsWith('-')) {
            throw new LiaraMcpError(
                `App name cannot start or end with a hyphen: "${name}"`,
                'INVALID_APP_NAME',
                { name },
                ['Remove leading/trailing hyphens', 'Example: "my-app" instead of "-my-app"']
            );
        }
    }
  • Helper function returning available platforms for app creation.
    export function getAvailablePlatforms(): Platform[] {
        return [
            'node',
            'nextjs',
            'laravel',
            'php',
            'django',
            'flask',
            'dotnet',
            'static',
            'react',
            'angular',
            'vue',
            'docker',
            'python',
            'go',
        ];
    }
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/razavioo/liara-mcp'

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