Skip to main content
Glama
tao12345666333

Civo MCP Server

create_instance

Provision cloud instances on Civo. Configure hostname, size, disk image, count, and region.

Instructions

Create a new cloud instance on Civo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostnameYesFully qualified domain name
sizeYesInstance size (e.g. g2.small)
template_idYesDisk image ID
countNoNumber of instances to create
regionNoRegion identifierLON1

Implementation Reference

  • Tool schema definition for create_instance, including name, description, and inputSchema with properties: hostname, size, template_id, count, region. Required fields: hostname, size, template_id.
    export const CREATE_INSTANCE_TOOL: Tool = {
      name: 'create_instance',
      description: 'Create a new cloud instance on Civo',
      inputSchema: {
        type: 'object',
        properties: {
          hostname: {
            type: 'string',
            description: 'Fully qualified domain name',
          },
          size: {
            type: 'string',
            description: 'Instance size (e.g. g2.small)',
          },
          template_id: {
            type: 'string',
            description: 'Disk image ID',
          },
          count: {
            type: 'number',
            description: 'Number of instances to create',
            default: 1,
          },
          region: {
            type: 'string',
            description: 'Region identifier',
            default: 'LON1',
          },
        },
        required: ['hostname', 'size', 'template_id'],
      },
    };
  • Request handler for the 'create_instance' tool in the CallToolRequestSchema switch statement. Validates arguments, calls the createInstance API function, and returns a formatted response with the created instance's hostname and ID.
    case 'create_instance': {
      if (
        typeof args !== 'object' ||
        args === null ||
        typeof args.hostname !== 'string' ||
        typeof args.size !== 'string' ||
        typeof args.template_id !== 'string'
      ) {
        throw new Error('Invalid arguments for create_instance');
      }
    
      const instance = await createInstance({
        hostname: args.hostname as string,
        size: args.size as string,
        template_id: args.template_id as string,
        count: args.count as number | undefined,
        region: args.region as string | undefined,
      });
      return {
        content: [
          {
            type: 'text',
            text: `Created instance ${instance.hostname} (ID: ${instance.id})`,
          },
        ],
        isError: false,
      };
    }
  • The actual API implementation of createInstance. Makes a POST request to Civo API /instances endpoint with form-encoded parameters (hostname, size, template_id, count, region), checks rate limit, and returns the created CivoInstance.
    export async function createInstance(params: {
      hostname: string;
      size: string;
      template_id: string;
      count?: number;
      region?: string;
    }): Promise<CivoInstance> {
      checkRateLimit();
    
      const url = `${CIVO_API_URL}/instances`;
      const response = await fetch(url, {
        method: 'POST',
        headers: {
          Authorization: `Bearer ${CIVO_API_KEY}`,
          'Content-Type': 'application/x-www-form-urlencoded',
        },
        body: new URLSearchParams({
          hostname: params.hostname,
          size: params.size,
          template_id: params.template_id,
          count: params.count?.toString() || '1',
          region: params.region || 'LON1',
        }),
      });
    
      if (!response.ok) {
        throw new Error(
          `Civo API error: ${response.status} ${response.statusText}`
        );
      }
    
      return response.json();
    }
  • src/index.ts:71-93 (registration)
    Registration of CREATE_INSTANCE_TOOL in the server's capabilities under the tools object.
            [CREATE_INSTANCE_TOOL.name]: CREATE_INSTANCE_TOOL,
            [LIST_INSTANCES_TOOL.name]: LIST_INSTANCES_TOOL,
            [REBOOT_INSTANCE_TOOL.name]: REBOOT_INSTANCE_TOOL,
            [SHUTDOWN_INSTANCE_TOOL.name]: SHUTDOWN_INSTANCE_TOOL,
            [START_INSTANCE_TOOL.name]: START_INSTANCE_TOOL,
            [RESIZE_INSTANCE_TOOL.name]: RESIZE_INSTANCE_TOOL,
            [DELETE_INSTANCE_TOOL.name]: DELETE_INSTANCE_TOOL,
            [LIST_DISK_IMAGES_TOOL.name]: LIST_DISK_IMAGES_TOOL,
            [GET_DISK_IMAGE_TOOL.name]: GET_DISK_IMAGE_TOOL,
            [LIST_SIZES_TOOL.name]: LIST_SIZES_TOOL,
            [LIST_REGIONS_TOOL.name]: LIST_REGIONS_TOOL,
            [LIST_NETWORKS_TOOL.name]: LIST_NETWORKS_TOOL,
            [CREATE_NETWORK_TOOL.name]: CREATE_NETWORK_TOOL,
            [RENAME_NETWORK_TOOL.name]: RENAME_NETWORK_TOOL,
            [DELETE_NETWORK_TOOL.name]: DELETE_NETWORK_TOOL,
            [LIST_KUBERNETES_CLUSTERS_TOOL.name]: LIST_KUBERNETES_CLUSTERS_TOOL,
            [CREATE_KUBERNETES_CLUSTER_TOOL.name]: CREATE_KUBERNETES_CLUSTER_TOOL,
            [DELETE_KUBERNETES_CLUSTER_TOOL.name]: DELETE_KUBERNETES_CLUSTER_TOOL,
            [LIST_KUBERNETES_VERSIONS_TOOL.name]: LIST_KUBERNETES_VERSIONS_TOOL,
          },
        },
      }
    );
  • Rate limiting helper (checkRateLimit) used by createInstance to enforce API call limits.
    export function checkRateLimit() {
      const now = Date.now();
      if (now - requestCount.lastReset > 1000) {
        requestCount.second = 0;
        requestCount.lastReset = now;
      }
      if (
        requestCount.second >= RATE_LIMIT.perSecond ||
        requestCount.month >= RATE_LIMIT.perMonth
      ) {
        throw new Error('Rate limit exceeded');
      }
      requestCount.second++;
      requestCount.month++;
    }
Behavior1/5

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

With no annotations, the description must disclose behavioral traits but only states the action; no mention of startup behavior, idempotency, or failure modes.

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?

Single sentence is concise and front-loaded, but omits potentially valuable context; not verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks detail on return values, side effects, or lifecycle behavior; given no output schema and 5 parameters, the description is insufficient for complete understanding.

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?

Schema coverage is 100%, so descriptions for each parameter exist; the tool description adds no extra semantic value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 (cloud instance) on a specific platform (Civo), differentiating it from siblings like create_kubernetes_cluster.

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?

No guidance on when to use this tool versus alternatives (e.g., create_kubernetes_cluster) or prerequisites, leaving the agent without context for selection.

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/tao12345666333/civo-mcp'

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