Skip to main content
Glama

liara_get_vm

Retrieve virtual machine details including configuration, status, and specifications from the Liara cloud platform using the VM ID.

Instructions

Get details of a virtual machine

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vmIdYesThe VM ID

Implementation Reference

  • The core handler function that executes the logic to retrieve details of a specific Liara virtual machine (VM) by ID using the IaaS API.
    */ export async function getVM( client: LiaraClient, vmId: string ): Promise<VirtualMachine> { validateRequired(vmId, 'VM ID'); const iaasClient = createIaaSClient(client); return await iaasClient.get<VirtualMachine>(`/vm/${vmId}`); }
  • Type definition for the VirtualMachine object, which represents the output schema of the liara_get_vm tool.
    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: https://iaas-api.liara.ir), used by getVM.
    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', }); }
  • Type definition for VmStatus used in VirtualMachine.
    export type VmStatus = 'RUNNING' | 'STOPPED' | 'CREATING' | 'FAILED';

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