Skip to main content
Glama

get_k8s_resource_details

Retrieve the manifest of a Kubernetes resource using cluster ID and resource UID for precise details and security insights.

Instructions

Get the latest manifest of a Kubernetes resource

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_idYesID of the Kubernetes cluster
resource_uidYesResource UID to get the details for

Implementation Reference

  • The main handler function that fetches the latest Kubernetes resource manifest via the RAD Security client API, decodes base64 raw manifest, and returns the details.
    export async function getKubernetesResourceDetails( client: RadSecurityClient, clusterId: string, resourceUid: string ): Promise<any> { const details = await client.makeRequest( `/clusters/${clusterId}/resources/${resourceUid}/latest` ); if (!details) { throw new Error(`No details found for resource_uid: ${resourceUid} in cluster: ${clusterId}`); } // Decode the base64 raw manifest if (details.raw) { details.raw = Buffer.from(details.raw, 'base64').toString('utf-8'); } return details; }
  • Zod input schema defining cluster_id and resource_uid parameters for the tool.
    export const GetKubernetesResourceDetailsSchema = z.object({ cluster_id: z.string().describe("ID of the Kubernetes cluster"), resource_uid: z.string().describe("Resource UID to get the details for"), });
  • src/index.ts:209-212 (registration)
    Tool registration in the listTools handler, defining name, description, and input schema.
    name: "get_k8s_resource_details", description: "Get the latest manifest of a Kubernetes resource", inputSchema: zodToJsonSchema(kubeobject.GetKubernetesResourceDetailsSchema), },
  • Dispatch handler in the CallToolRequest switch statement that parses arguments, calls the kubeobject handler, and formats the MCP response.
    case "get_k8s_resource_details": { const args = kubeobject.GetKubernetesResourceDetailsSchema.parse(request.params.arguments); const response = await kubeobject.getKubernetesResourceDetails( client, args.cluster_id, args.resource_uid ); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }], };

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/rad-security/mcp-server'

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