Skip to main content
Glama

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) }, ], };

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