Skip to main content
Glama
rad-security

RAD Security

Official
by rad-security

get_containers_baselines

Retrieve runtime security baselines for multiple containers to establish normal behavior patterns and detect anomalies in Kubernetes environments.

Instructions

Get runtime baselines for multiple containers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
container_idsYesList of container IDs to get baselines for

Implementation Reference

  • The core handler function that executes the tool logic: fetches container runtime insights and baselines for specified container IDs using the RadSecurityClient API.
    export async function getContainersBaselines(
      client: RadSecurityClient,
      containerIds: string[]
    ): Promise<any> {
      if (containerIds.length === 0) {
        throw new Error("No container IDs provided");
      }
    
      // Convert list to comma-separated string for API request
      const containerIdsParam = containerIds.join(',');
    
      // Get container runtime insights for all containers
      const cris = await client.makeRequest(
        `/accounts/${client.getAccountId()}/container_runtime_insights`,
        { container_ids: containerIdsParam }
      );
    
      if (!cris.entries) {
        throw new Error(`No process trees found for container_ids: ${containerIds}`);
      }
    
      // Map to store results
      const baselines: Record<string, any> = {};
    
      // Process each container runtime insight
      for (const entry of cris.entries) {
        const criId = entry.id;
        const containerId = entry.summary?.container_meta?.container_id;
    
        if (!containerId || !containerIds.includes(containerId)) {
          continue;
        }
    
        // Get detailed data for this container
        const data = await client.makeRequest(
          `/accounts/${client.getAccountId()}/container_runtime_insights/${criId}`
        );
    
        if (data.baseline) {
          baselines[containerId] = data.baseline;
        } else {
          // Just log a warning instead of raising an error to allow partial results
          console.warn(`No baseline found for container_id: ${containerId}`);
        }
      }
    
      if (Object.keys(baselines).length === 0) {
        throw new Error(`No baselines found for any of the container_ids: ${containerIds}`);
      }
    
      return baselines;
    }
  • Zod schema defining the input parameters for the get_containers_baselines tool (array of container_ids).
    export const GetContainersBaselinesSchema = z.object({
      container_ids: z.array(z.string()).describe("List of container IDs to get baselines for"),
    });
  • src/index.ts:369-374 (registration)
    Tool registration in the listTools handler, defining the tool name, description, and input schema for MCP tool listing.
      name: "get_containers_baselines",
      description: "Get runtime baselines for multiple containers",
      inputSchema: zodToJsonSchema(
        runtime.GetContainersBaselinesSchema
      ),
    },
  • src/index.ts:1150-1162 (registration)
    Tool dispatch in the CallToolRequest handler switch statement: parses args with schema and calls the runtime.getContainersBaselines handler.
    case "get_containers_baselines": {
      const args = runtime.GetContainersBaselinesSchema.parse(
        request.params.arguments
      );
      const response = await runtime.getContainersBaselines(
        client,
        args.container_ids
      );
      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 the full burden. It states what the tool does but lacks behavioral details like whether this is a read-only operation, what format the baselines are returned in, if there are rate limits, or any authentication requirements. This is a significant gap for a tool with no annotation coverage.

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 directly states the tool's purpose without any fluff or redundancy. It is appropriately sized and front-loaded, 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'runtime baselines' entail, how results are structured, or any behavioral traits, leaving gaps in understanding for a tool that likely returns complex data.

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%, with the parameter 'container_ids' well-documented in the schema as 'List of container IDs to get baselines for'. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3.

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 verb 'Get' and the resource 'runtime baselines for multiple containers', making the purpose specific and understandable. It distinguishes from siblings like 'get_container_details' by focusing on baselines rather than general details, though it doesn't explicitly contrast with them.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context, or exclusions, leaving the agent to 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