Skip to main content
Glama
rad-security

RAD Security

Official
by rad-security

list_k8s_resources

List Kubernetes resources with optional filtering by namespace, resource types, and cluster to retrieve security insights and runtime data.

Instructions

List Kubernetes resources with optional filtering by namespace, resource types, and cluster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNoNamespace to filter resources
kindsNoList of kinds to filter. Example: ['Deployment', 'ServiceAccount', 'Pod']
cluster_idNoCluster ID to filter resources
pageNoPage number for pagination
page_sizeNoNumber of items per page

Implementation Reference

  • The handler function that executes the tool logic: constructs query parameters and calls the RAD Security API to list Kubernetes resources.
    export async function listKubernetesResources(
      client: RadSecurityClient,
      kinds: string[] | undefined,
      namespace?: string,
      clusterId?: string,
      page: number = 1,
      pageSize: number = 20
    ): Promise<any> {
      const params: Record<string, any> = {
        page,
        page_size: pageSize,
        resource_types: kinds?.join(',')
      };
    
      if (namespace) {
        params.namespace = namespace;
      }
    
      if (clusterId) {
        params.cluster_id = clusterId;
      }
    
      return client.makeRequest(
        `/accounts/${client.getAccountId()}/resources`,
        params
      );
    }
  • Zod schema defining the input parameters for the list_k8s_resources tool.
    export const ListKubernetesResourcesSchema = z.object({
      namespace: z.string().optional().describe("Namespace to filter resources"),
      kinds: z.array(z.string()).optional().describe("List of kinds to filter. Example: ['Deployment', 'ServiceAccount', 'Pod']"),
      cluster_id: z.string().optional().describe("Cluster ID to filter resources"),
      page: z.number().optional().default(1).describe("Page number for pagination"),
      page_size: z.number().optional().default(20).describe("Number of items per page"),
    });
  • src/index.ts:319-326 (registration)
    Tool metadata registration in the listTools handler, including name, description, and input schema.
    {
      name: "list_k8s_resources",
      description:
        "List Kubernetes resources with optional filtering by namespace, resource types, and cluster",
      inputSchema: zodToJsonSchema(
        kubeobject.ListKubernetesResourcesSchema
      ),
    },
  • src/index.ts:1073-1089 (registration)
    Dispatch handler in the CallToolRequest switch statement that parses args and invokes the listKubernetesResources function.
    case "list_k8s_resources": {
      const args = kubeobject.ListKubernetesResourcesSchema.parse(
        request.params.arguments
      );
      const response = await kubeobject.listKubernetesResources(
        client,
        args.kinds,
        args.namespace,
        args.cluster_id,
        args.page,
        args.page_size
      );
      return {
        content: [
          { type: "text", text: JSON.stringify(response, null, 2) },
        ],
      };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions optional filtering but doesn't disclose behavioral traits like whether this is a read-only operation, what permissions are required, whether results are paginated (though schema hints at it), rate limits, or error conditions. The description is minimal and lacks critical operational context for a Kubernetes resource listing tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('List Kubernetes resources') and briefly mentions the filtering capabilities. There's no wasted language or redundancy, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of Kubernetes resources and lack of annotations or output schema, the description is insufficient. It doesn't explain what 'resources' encompasses (e.g., pods, deployments, services), how results are structured, whether all resource types are included by default, or any authentication requirements. For a tool with 5 parameters and no structured behavioral hints, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 5 parameters with descriptions and defaults. The description adds minimal value by mentioning the filtering options (namespace, resource types, cluster) but doesn't provide additional semantics beyond what's in the schema. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('Kubernetes resources'), and specifies optional filtering parameters. It distinguishes from siblings like 'get_k8s_resource_details' by focusing on listing with filters rather than retrieving detailed information about a specific resource. However, it doesn't explicitly contrast with other listing tools like 'list_clusters' or 'list_cloud_resources'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when filtering is appropriate, what happens without filters, or how this differs from other listing tools like 'list_clusters' or 'list_cloud_resources'. The agent must infer usage from the tool name and parameters alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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