Skip to main content
Glama

get-crd

Retrieve custom resource definitions from Kubernetes clusters to view their structure and configuration details.

Instructions

Get a custom resource definition

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the CRD

Implementation Reference

  • The execution handler for the 'get-crd' tool. It runs 'kubectl get crd [name] -o yaml' and returns the stdout as text content.
      const { name } = args;
      const cmd = `kubectl get crd ${name} -o yaml`;
      const { stdout } = await execAsync(cmd);
      return {
        content: [{ type: "text", text: stdout || "CRD not found" }]
      };
    }
  • The tool schema and registration entry in the tools array, defining the name, description, and input schema (requiring 'name' parameter).
    {
      name: "get-crd",
      description: "Get a custom resource definition",
      inputSchema: {
        type: "object",
        properties: {
          name: { 
            type: "string",
            description: "The name of the CRD"
          }
        },
        required: ["name"]
      }
    },
  • server.js:1392-1394 (registration)
    The server request handler for listing tools, which returns the full 'tools' array including the 'get-crd' tool definition.
    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