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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the CRD |
Implementation Reference
- server.js:2031-2037 (handler)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" }] }; }
- server.js:964-977 (schema)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 }; });