Skip to main content
Glama

liara_create_vm

Create a new virtual machine on the Liara cloud platform by specifying name, plan, operating system, and network configuration.

Instructions

Create a new virtual machine

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesVM name
planIDYesPlan ID for the VM
osYesOperating system
sshKeyNoSSH public key (optional)
networkYesNetwork ID (required by the API)

Implementation Reference

  • The core handler function that implements the liara_create_vm tool logic by calling the Liara IaaS API to create a new virtual machine.
    /**
     * Create a new virtual machine
     */
    export async function createVM(
        client: LiaraClient,
        request: CreateVmRequest
    ): Promise<VirtualMachine> {
        validateRequired(request.name, 'VM name');
        validateRequired(request.planID, 'Plan ID');
        validateRequired(request.os, 'Operating system');
        validateRequired(request.network, 'Network ID');
    
        const iaasClient = createIaaSClient(client);
        return await iaasClient.post<VirtualMachine>('/vm', request);
    }
  • Input schema (type definition) for the createVM request parameters.
    export interface CreateVmRequest {
        name: string;
        planID: string;
        os: string;
        sshKey?: string;
        network: string;
    }
  • Output schema for the created VirtualMachine.
    export interface VirtualMachine {
        _id: string;
        name: string;
        planID: string;
        status: VmStatus;
        os: string;
        ip?: string;
        createdAt: string;
    }
  • Helper function to create a specialized LiaraClient for IaaS API (different base URL). Used internally by createVM.
    /**
     * Create a specialized IaaS client with the IaaS API base URL
     */
    function createIaaSClient(client: LiaraClient): LiaraClient {
        // Access the internal client to get the API token
        const internalClient = (client as any).client;
        const apiToken = internalClient?.defaults?.headers?.Authorization?.replace('Bearer ', '') || 
                         process.env.LIARA_API_TOKEN;
        const teamId = (client as any).teamId || process.env.LIARA_TEAM_ID;
    
        if (!apiToken) {
            throw new Error('API token is required for IaaS operations');
        }
    
        // Create new client with IaaS base URL
        // Import LiaraClient class dynamically
        return new LiaraClient({
            apiToken,
            teamId,
            baseURL: 'https://iaas-api.liara.ir',
        });
    }
Behavior2/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. 'Create a new virtual machine' implies a mutation/write operation, but it doesn't disclose any behavioral traits: no information on permissions required, whether this is a long-running operation, what happens on failure, rate limits, or what the response looks like (since no output schema exists). For a creation tool with zero annotation coverage, this is a significant gap.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable. Every word earns its place, and there's no redundancy or unnecessary elaboration.

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 complexity of creating a virtual machine (a significant mutation with 5 parameters), the lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like permissions, execution time, error handling, or response format. While the schema covers parameters well, the overall context for safe and effective use is inadequate.

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 100%, with all 5 parameters clearly documented in the schema itself. The description adds no parameter-specific information beyond what's in the schema (e.g., no context on valid OS values, planID sources, or network requirements). According to the rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 action ('Create') and resource ('virtual machine'), making the purpose immediately understandable. It distinguishes from siblings like 'liara_create_app' or 'liara_create_database' by specifying the VM resource type. However, it doesn't explicitly differentiate from other VM-related tools like 'liara_resize_vm' or 'liara_start_vm' beyond the 'create' verb.

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 no guidance on when to use this tool versus alternatives. There's no mention of prerequisites (e.g., needing a planID or network first), when not to use it (e.g., for modifying existing VMs), or how it relates to sibling tools like 'liara_get_vm' or 'liara_list_vms'. The agent must infer usage from the name and schema alone.

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/razavioo/liara-mcp'

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