get_container_details
Retrieve detailed security information about a specific container in Kubernetes or cloud environments to analyze configurations and identify potential vulnerabilities.
Instructions
Get detailed information about a container secured by RAD Security
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_id | Yes | ID of the container to get details for |
Implementation Reference
- src/operations/containers.ts:33-57 (handler)The core handler function that executes the tool logic by querying the RAD Security API for container details using a container_id filter, handles errors for no/multiple matches, cleans the response, and returns the details.export async function getContainerDetails( client: RadSecurityClient, containerId: string ): Promise<any> { const response = await client.makeRequest( `/accounts/${client.getAccountId()}/inventory_containers`, { filters: `container_id:${containerId}` }, ); if (!response || !response.entries || response.entries.length === 0) { throw new Error(`No container found with ID: ${containerId}`); } if (response.entries.length > 1) { throw new Error( `Found multiple containers with ID: ${containerId}. Please provide a more specific container ID.` ); } // Remove "id" from the response to avoid confusion const result = response.entries[0]; delete result.id; return result; }
- src/operations/containers.ts:11-13 (schema)Zod schema defining the input parameters for the tool, specifically requiring a container_id string.export const GetContainerDetailsSchema = z.object({ container_id: z.string().describe("ID of the container to get details for"), });
- src/index.ts:137-143 (registration)Tool registration in the ListTools handler, defining the tool name, description, and input schema for discovery.name: "get_container_details", description: "Get detailed information about a container secured by RAD Security", inputSchema: zodToJsonSchema( containers.GetContainerDetailsSchema ), },
- src/index.ts:739-752 (registration)Tool execution handler in the CallToolRequest switch case, which validates input with the schema, calls the handler function, and formats the response as MCP content.case "get_container_details": { const args = containers.GetContainerDetailsSchema.parse( request.params.arguments ); const response = await containers.getContainerDetails( client, args.container_id ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], }; }