Skip to main content
Glama

list_k8s_resource_misconfigs

Identify Kubernetes resource misconfigurations using UID for enhanced security and compliance in cloud environments.

Instructions

Get manifest misconfigurations for a Kubernetes resource

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resource_uidYesKubernetes resource UID to get misconfigurations for

Implementation Reference

  • The main handler function that executes the tool logic: queries the RAD Security API for misconfigurations on the given Kubernetes resource UID, deduplicates entries by policy human_id, and returns the processed list.
    export async function listKubernetesResourceMisconfigurations( client: RadSecurityClient, resourceUid: string ): Promise<any> { const misconfigs = await client.makeRequest( `/accounts/${client.getAccountId()}/misconfig`, { kubeobject_uids: resourceUid, page_size: 50 } ); // deduplicate the list based on field "guard_policy.human_id" const seenIds = new Set<string>(); const toReturn = []; for (const misconfig of misconfigs.entries) { const humanId = misconfig.guard_policy.human_id; if (!seenIds.has(humanId)) { seenIds.add(humanId); toReturn.push({ id: misconfig.id, cluster_id: misconfig.cluster_id, title: misconfig.guard_policy.title, human_id: misconfig.guard_policy.human_id, }); } } misconfigs.entries = toReturn; return misconfigs; }
  • Zod schema defining the input parameters for the tool (resource_uid). Used in registration and validation.
    export const ListKubernetesResourceMisconfigurationsSchema = z.object({ resource_uid: z.string().describe("Kubernetes resource UID to get misconfigurations for"), });
  • src/index.ts:221-225 (registration)
    Tool registration in the MCP server's listTools handler, defining name, description, and schema.
    { name: "list_k8s_resource_misconfigs", description: "Get manifest misconfigurations for a Kubernetes resource", inputSchema: zodToJsonSchema(misconfigs.ListKubernetesResourceMisconfigurationsSchema), },
  • src/index.ts:584-593 (registration)
    Dispatcher case in the MCP server's CallToolRequest handler that validates input, calls the tool handler, and formats the response.
    case "list_k8s_resource_misconfigs": { const args = misconfigs.ListKubernetesResourceMisconfigurationsSchema.parse(request.params.arguments); const response = await misconfigs.listKubernetesResourceMisconfigurations( client, 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