Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

ks_create_cluster

Creates a new Kubernetes cluster with specified name, datacenter, and machine type on IBM Cloud.

Instructions

Create a new Kubernetes cluster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
datacenterYesZone e.g. dal10
machine_typeYesWorker machine type
worker_numNo
kube_versionNo
resource_group_idNo
providerNo
vpc_idNo
subnet_idNo

Implementation Reference

  • The handler function for the ks_create_cluster tool. It calls assertWriteAllowed to check write permissions, then sends a POST request to the IBM Cloud Kubernetes API endpoint /v2/createCluster with the provided parameters (name, datacenter, machine_type, worker_num, kube_version, provider, vpc_id, subnet_id, resource_group_id). Uses safeTool wrapper for error handling.
    }, async (p) => safeTool(async () => { w();
      return client.post(`${base}/v2/createCluster`, {
        name:p.name, dataCenter:p.datacenter, machineType:p.machine_type,
        workerNum:p.worker_num||1, kubeVersion:p.kube_version,
        provider:p.provider||"vpc-gen2", vpcID:p.vpc_id, subnetID:p.subnet_id,
        resourceGroup:p.resource_group_id,
      });
    }));
  • The schema/input parameter definitions for ks_create_cluster. Defines the Zod validation schema with required fields (name, datacenter, machine_type) and optional fields (worker_num, kube_version, resource_group_id, provider with enum ['classic','vpc-gen2'], vpc_id, subnet_id).
    server.tool("ks_create_cluster", "Create a new Kubernetes cluster", {
      name: z.string(), datacenter: z.string().describe("Zone e.g. dal10"),
      machine_type: z.string().describe("Worker machine type"), worker_num: z.number().optional(),
      kube_version: z.string().optional(), resource_group_id: z.string().optional(),
      provider: z.enum(["classic","vpc-gen2"]).optional(),
      vpc_id: z.string().optional(), subnet_id: z.string().optional(),
  • The tool registration via server.tool() call. The ks_create_cluster tool is registered inside the registerKubernetesTools function (line 7) which is called from src/server.ts line 56. The tool name is 'ks_create_cluster' with description 'Create a new Kubernetes cluster'.
    server.tool("ks_create_cluster", "Create a new Kubernetes cluster", {
      name: z.string(), datacenter: z.string().describe("Zone e.g. dal10"),
      machine_type: z.string().describe("Worker machine type"), worker_num: z.number().optional(),
      kube_version: z.string().optional(), resource_group_id: z.string().optional(),
      provider: z.enum(["classic","vpc-gen2"]).optional(),
      vpc_id: z.string().optional(), subnet_id: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
      return client.post(`${base}/v2/createCluster`, {
        name:p.name, dataCenter:p.datacenter, machineType:p.machine_type,
        workerNum:p.worker_num||1, kubeVersion:p.kube_version,
        provider:p.provider||"vpc-gen2", vpcID:p.vpc_id, subnetID:p.subnet_id,
        resourceGroup:p.resource_group_id,
      });
    }));
  • The safeTool helper function wraps the handler to catch errors and return proper MCP text content responses (success or error). Also, assertWriteAllowed (line 14-18) is called as w() inside the handler to enforce read-only mode when writes are disabled.
    export async function safeTool<T>(fn: () => Promise<T>): Promise<ReturnType<typeof successContent> | ReturnType<typeof errorContent>> {
      try {
        const result = await fn();
        return successContent(result);
      } catch (error) {
        return errorContent(error);
      }
    }
  • The KUBERNETES endpoint constant used by the tool. The base URL is 'https://containers.cloud.ibm.com/global', and the tool appends '/v2/createCluster' to it.
    export const IBM_ENDPOINTS = {
      IAM: "https://iam.cloud.ibm.com",
      IAM_IDENTITY: "https://iam.cloud.ibm.com/v1",
      IAM_ACCESS_GROUPS: "https://iam.cloud.ibm.com/v2",
      IAM_POLICY: "https://iam.cloud.ibm.com/v1",
      USER_MANAGEMENT: (accountId: string) =>
        `https://user-management.cloud.ibm.com/v2/accounts/${accountId}`,
    
      VPC: (region: string) =>
        `https://${region}.iaas.cloud.ibm.com/v1`,
    
      KUBERNETES: "https://containers.cloud.ibm.com/global",
Behavior1/5

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

No annotations exist, and the description provides no behavioral details such as whether the operation is asynchronous, what permissions are needed, or potential side effects. A creation tool should disclose long-running nature or resource limits.

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

Conciseness3/5

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

The description is a single sentence, which is concise but under-informative. It could include key constraints or return value hints without significant length increase.

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?

For a creation tool with no output schema and many undocumented parameters, the description fails to provide enough context. Agents need to know what happens after creation, such as returned cluster ID or status, and how to use related tools like ks_get_cluster.

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

Parameters2/5

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

The description adds no meaning to the 9 parameters shown in the input schema. Schema description coverage is only 22%, leaving most parameters (e.g., name, worker_num, vpc_id) unexplained by either schema or description.

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 the resource ('a new Kubernetes cluster'), making it distinct from sibling tools like ks_delete_cluster or ks_list_clusters.

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, prerequisites, or constraints. The description lacks any contextual use instructions.

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