Skip to main content
Glama
rad-security

RAD Security

Official
by rad-security

list_image_vulnerabilities

Identify security vulnerabilities in container images by analyzing image digests and filtering results by severity levels.

Instructions

List vulnerabilities in a container image with optional filtering by severity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
digestYesImage digest (required for vulnerabilities)
severitiesNoList of severity levels to filter
pageNoPage number for pagination
page_sizeNoNumber of items per page

Implementation Reference

  • The core handler function that implements the tool logic for listing vulnerabilities in a specified container image. It retrieves the latest scan for the image, queries its vulnerabilities with optional severity filtering and pagination, removes CPEs to optimize for LLM context, and returns the results.
    export async function listImageVulnerabilities(
      client: RadSecurityClient,
      digest: string,
      severities?: string[],
      page: number = 1,
      page_size: number = 20
    ): Promise<any> {
      const params: Record<string, any> = { page, page_size, sort: "severity:desc" };
      if (severities && severities.length > 0) {
        params.severities = severities.join(",");
      }
    
      const scans = await listImageScans(client, digest);
    
      if (!scans || !scans.entries || scans.entries.length === 0) {
        throw new Error(`Image with digest: ${digest} hasn't been scanned yet`);
      }
    
      // Get the latest scan
      const scanId = scans.entries[0].id;
    
      const vulns = await client.makeRequest(
        `/accounts/${client.getAccountId()}/images/${digest}/scans/${scanId}/vulnerabilities`,
        params
      );
    
      // Remove CPEs to reduce context window size when used with LLMs
      vulns.entries.forEach((vuln: any) => {
        if (vuln.cpes) {
          delete vuln.cpes;
        }
      });
    
      return vulns;
    }
  • Zod schema defining the input parameters for the list_image_vulnerabilities tool, including required image digest and optional severities, page, and page_size.
    export const ListImageVulnerabilitiesSchema = z.object({
      digest: z.string().describe("Image digest (required for vulnerabilities)"),
      severities: z.array(z.string()).optional().describe("List of severity levels to filter"),
      page: z.number().optional().default(1).describe("Page number for pagination"),
      page_size: z.number().optional().default(100).describe("Number of items per page"),
    });
  • src/index.ts:289-296 (registration)
    Registration of the tool in the ListToolsRequest handler, specifying the tool name, description, and input schema converted to JSON schema.
    {
      name: "list_image_vulnerabilities",
      description:
        "List vulnerabilities in a container image with optional filtering by severity",
      inputSchema: zodToJsonSchema(
        images.ListImageVulnerabilitiesSchema
      ),
    },
  • src/index.ts:1021-1037 (registration)
    Dispatch handler registration in the CallToolRequest handler that validates input arguments using the schema, invokes the listImageVulnerabilities function with the client and parsed args, and formats the response as MCP content.
    case "list_image_vulnerabilities": {
      const args = images.ListImageVulnerabilitiesSchema.parse(
        request.params.arguments
      );
      const response = await images.listImageVulnerabilities(
        client,
        args.digest,
        args.severities,
        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?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool lists vulnerabilities but omits critical details like whether this is a read-only operation, if it requires specific permissions, pagination behavior (implied by parameters but not described), rate limits, or error conditions. The description is insufficient for a mutation-sensitive context.

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 vulnerabilities in a container image') and adds a useful modifier ('with optional filtering by severity'). There is zero waste or redundancy.

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

Completeness3/5

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

For a tool with 4 parameters, 100% schema coverage, and no output schema, the description is minimally adequate. It covers the basic purpose but lacks behavioral context (e.g., pagination details, error handling) and usage guidelines relative to siblings. The absence of annotations and output schema increases the need for more descriptive completeness.

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 parameters (digest, severities, page, page_size). The description adds minimal value by mentioning optional filtering by severity, which aligns with the 'severities' parameter but doesn't provide additional semantics beyond what the schema already states.

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 vulnerabilities') and resource ('in a container image'), with the optional filtering by severity adding specificity. It distinguishes itself from sibling tools like 'get_image_sbom' or 'get_top_vulnerable_images' by focusing on vulnerabilities per image, but 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?

The description mentions optional filtering by severity, which provides some usage context, but lacks explicit guidance on when to use this tool versus alternatives like 'search_cves' or 'list_security_findings'. No prerequisites, exclusions, or comparative advice are provided.

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