Skip to main content
Glama

create-namespace

Create a new namespace in Kubernetes clusters to organize and isolate resources, enabling logical separation for applications or teams.

Instructions

Create a new namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the namespace to create

Implementation Reference

  • Handler function that executes the 'kubectl create namespace' command using the provided namespace name and returns the command output or a success message.
    case "create-namespace": {
      const { name } = args;
      const cmd = `kubectl create namespace ${name}`;
      const { stdout } = await execAsync(cmd);
      return {
        content: [{ 
          type: "text", 
          text: stdout || `Created namespace ${name}` 
        }]
      };
    }
  • Tool schema definition including name, description, and input schema requiring a 'name' parameter of type string.
      name: "create-namespace",
      description: "Create a new namespace",
      inputSchema: {
        type: "object",
        properties: {
          name: { 
            type: "string",
            description: "The name of the namespace to create"
          }
        },
        required: ["name"]
      }
    },
  • server.js:1392-1394 (registration)
    Registration of all tools list handler, which includes 'create-namespace' in the tools array returned to clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { 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/thekaranpargaie/kube-mcp'

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