Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

vpc_create_instance

Create a virtual server instance on IBM Cloud VPC by specifying required parameters like name, VPC, zone, profile, image, and subnet. Optionally add SSH keys and resource group.

Instructions

Create a virtual server instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
vpc_idYes
zoneYes
profileYese.g. bx2-2x8
image_idYes
subnet_idYes
ssh_key_idsNoComma-separated SSH key IDs
resource_group_idNo
regionNo

Implementation Reference

  • The handler function for 'vpc_create_instance' tool. It parses SSH key IDs, constructs the VPC instance payload (with name, vpc, zone, profile, image, primary_network_interface, keys, resource_group), and sends a POST request to the VPC API /instances endpoint.
    server.tool("vpc_create_instance", "Create a virtual server instance", {
      name: z.string(), vpc_id: z.string(), zone: z.string(), profile: z.string().describe("e.g. bx2-2x8"),
      image_id: z.string(), subnet_id: z.string(), ssh_key_ids: z.string().optional().describe("Comma-separated SSH key IDs"),
      resource_group_id: z.string().optional(), region: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
      const keys = p.ssh_key_ids?.split(",").map(id=>({id:id.trim()}))||[];
      return client.post(vpcUrl(p.region||r, "/instances"), {name:p.name,vpc:{id:p.vpc_id},zone:{name:p.zone},profile:{name:p.profile},image:{id:p.image_id},primary_network_interface:{subnet:{id:p.subnet_id}},keys,resource_group:p.resource_group_id?{id:p.resource_group_id}:undefined});
    }));
  • Zod schema definition for 'vpc_create_instance' input parameters: name (string), vpc_id (string), zone (string), profile (string with description), image_id (string), subnet_id (string), ssh_key_ids (optional string), resource_group_id (optional string), region (optional string).
    server.tool("vpc_create_instance", "Create a virtual server instance", {
      name: z.string(), vpc_id: z.string(), zone: z.string(), profile: z.string().describe("e.g. bx2-2x8"),
      image_id: z.string(), subnet_id: z.string(), ssh_key_ids: z.string().optional().describe("Comma-separated SSH key IDs"),
      resource_group_id: z.string().optional(), region: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
  • Tool registered via server.tool('vpc_create_instance', ...) inside the registerVPCTools function which is called from src/server.ts at line 53.
    server.tool("vpc_create_instance", "Create a virtual server instance", {
      name: z.string(), vpc_id: z.string(), zone: z.string(), profile: z.string().describe("e.g. bx2-2x8"),
      image_id: z.string(), subnet_id: z.string(), ssh_key_ids: z.string().optional().describe("Comma-separated SSH key IDs"),
      resource_group_id: z.string().optional(), region: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
      const keys = p.ssh_key_ids?.split(",").map(id=>({id:id.trim()}))||[];
      return client.post(vpcUrl(p.region||r, "/instances"), {name:p.name,vpc:{id:p.vpc_id},zone:{name:p.zone},profile:{name:p.profile},image:{id:p.image_id},primary_network_interface:{subnet:{id:p.subnet_id}},keys,resource_group:p.resource_group_id?{id:p.resource_group_id}:undefined});
    }));
  • The vpcUrl helper function builds the VPC API URL with region, path, and version parameter. Used by the handler to construct the API endpoint.
    export function vpcUrl(region: string, path: string, version: string = "2024-11-19"): string {
      const base = `https://${region}.iaas.cloud.ibm.com/v1${path}`;
      const sep = base.includes("?") ? "&" : "?";
      return `${base}${sep}version=${version}&generation=2`;
    }
  • The assertWriteAllowed helper checks if write operations are allowed. Called via 'w()' at the start of the handler to enforce read-only mode.
    export function assertWriteAllowed(allowWrite: boolean): void {
      if (!allowWrite) {
        throw new WriteNotAllowedError();
      }
    }
Behavior1/5

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

No annotations are provided, so the description must disclose behavioral traits. It only states 'Create a virtual server instance' with no information about side effects, failure behavior, idempotency, permissions, or cost implications. This is severely lacking for a creation tool.

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

Conciseness2/5

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

The description is a single sentence, which is concise but at the expense of essential information. It is underspecified and does not earn its place as a useful guide. Conciseness should not sacrifice completeness.

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?

Given the complexity (9 parameters, 6 required, no annotations or output schema), the description is vastly insufficient. It provides no context about expected behavior, prerequisities, or what the tool accomplishes beyond the literal action. The agent would have to infer everything from the schema and tool name.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no value to parameter understanding. Only two of nine parameters (profile, ssh_key_ids) have descriptions in the schema, and the tool description does not elaborate on any parameter meaning, usage, or constraints. The description fails to compensate for the low schema coverage (22%).

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 server instance), distinguishing it from sibling tools like vpc_delete_instance or vpc_list_instances. However, it lacks specificity about the cloud provider or VPC context, though the tool name implies it.

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 vs alternatives, no prerequisites, and no mention of when not to use it. For example, it doesn't indicate that a VPC must exist first or that certain parameters are dependent.

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/ahmedselimmansor-ctrl/IBM_cloud_MCP_SERVER'

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