Skip to main content
Glama

zap.get_alerts_summary

Summarize security alerts by risk level from vulnerability scans to prioritize remediation actions and identify critical threats.

Instructions

Get summary of alerts by risk level

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseURLNoFilter by base URL (optional)

Implementation Reference

  • MCP tool registration for 'zap.get_alerts_summary', including input schema, description, and inline handler function that uses ZAPClient to fetch alerts summary.
      'zap.get_alerts_summary',
      {
        description: 'Get summary of alerts by risk level',
        inputSchema: {
          type: 'object',
          properties: {
            baseURL: {
              type: 'string',
              description: 'Filter by base URL (optional)',
            },
          },
        },
      },
      async ({ baseURL }: any): Promise<ToolResult> => {
        const client = getZAPClient();
        if (!client) {
          return formatToolResult(false, null, 'ZAP client not initialized');
        }
        const result = await client.getAlertsSummary(baseURL);
        return formatToolResult(result.success, result.data, result.error);
      }
    );
  • Inline handler function for the tool, which initializes ZAP client if needed and calls getAlertsSummary, formatting the result.
    async ({ baseURL }: any): Promise<ToolResult> => {
      const client = getZAPClient();
      if (!client) {
        return formatToolResult(false, null, 'ZAP client not initialized');
      }
      const result = await client.getAlertsSummary(baseURL);
      return formatToolResult(result.success, result.data, result.error);
    }
  • Input schema and description for the zap.get_alerts_summary tool.
    {
      description: 'Get summary of alerts by risk level',
      inputSchema: {
        type: 'object',
        properties: {
          baseURL: {
            type: 'string',
            description: 'Filter by base URL (optional)',
          },
        },
      },
    },
  • Core implementation of getAlertsSummary in ZAPClient class: Calls ZAP API /alert/view/alertCountsByRisk/, parses response into risk-level counts (informational, low, medium, high, critical).
    async getAlertsSummary(baseURL?: string): Promise<ZAPScanResult> {
      try {
        const params: any = {};
        if (baseURL) params.baseurl = baseURL;
    
        const response = await this.client.get('/alert/view/alertCountsByRisk/', { params });
        
        // Parse the response - ZAP returns alertCountsByRisk with risk levels as keys
        const summaryData = response.data.alertCountsByRisk || response.data;
        
        return {
          success: true,
          data: {
            informational: summaryData['0'] || summaryData.Informational || 0,
            low: summaryData['1'] || summaryData.Low || 0,
            medium: summaryData['2'] || summaryData.Medium || 0,
            high: summaryData['3'] || summaryData.High || 0,
            critical: summaryData['4'] || summaryData.Critical || 0,
            raw: summaryData,
          },
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.message || 'Failed to get alerts summary',
        };
      }
    }
  • src/index.ts:49-49 (registration)
    Top-level call to registerZAPTools which includes the zap.get_alerts_summary tool among other ZAP tools.
    registerZAPTools(server);
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 of behavioral disclosure. It states 'Get summary' implying a read-only operation, but doesn't cover aspects like authentication needs, rate limits, error handling, or what the summary format includes (e.g., counts, risk breakdown). This leaves significant gaps for a tool in a security 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, clear sentence with no wasted words, making it easy to parse and front-loaded. It efficiently conveys the core purpose without unnecessary elaboration, earning a high score for conciseness.

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 a security tool with no annotations and no output schema, the description is incomplete. It lacks details on what the summary includes, how risk levels are defined, or any behavioral traits, making it inadequate for an AI agent to fully understand the tool's operation in context.

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?

The input schema has 100% description coverage for its single parameter 'baseURL', which is documented as 'Filter by base URL (optional)'. The description doesn't add any extra meaning beyond this, such as examples or constraints, but the schema is sufficient, so a baseline score of 3 is appropriate.

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 'summary of alerts by risk level', making the purpose understandable. However, it doesn't differentiate from sibling tools like 'zap.get_alerts' (which might return detailed alerts vs. a summary), leaving room for improvement in specificity.

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, such as 'zap.get_alerts' for detailed alerts or other security tools. There's no mention of prerequisites, context, or exclusions, which limits its utility for an AI agent in selecting the right tool.

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/telmon95/VulneraMCP'

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