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

  • Registers the zap.get_alerts_summary MCP tool with input schema (optional baseURL) and a thin handler that retrieves the ZAP client and calls its getAlertsSummary method.
    server.tool( '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); } );
  • Implements the core logic for retrieving alerts summary from ZAP by calling the /alert/view/alertCountsByRisk/ API endpoint, parsing counts by risk level (informational, low, medium, high, critical), and returning formatted ZAPScanResult.
    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', }; } }
  • Type definition for ZAPScanResult, the standardized return type used by getAlertsSummary and other ZAP API methods.
    export interface ZAPScanResult { success: boolean; data?: any; error?: string; }

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