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);

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