manage_alerts
Monitor and control security alerts for web application attack patterns, including creating, updating, listing, and deleting alert configurations with custom thresholds and intervals.
Instructions
Manage alerts for monitoring attack patterns
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| corpName | No | Corporation name (uses context default if not provided) | |
| siteName | No | Site name (uses context default if not provided) | |
| action | Yes | Action to perform | |
| alertId | No | Alert ID (for update/delete actions) | |
| tagName | No | Tag name to monitor | |
| longName | No | Alert description | |
| interval | No | Time interval in minutes | |
| threshold | No | Threshold count | |
| enabled | No | Whether alert is enabled | |
| action_type | No | Action when triggered |
Implementation Reference
- server.js:1100-1133 (handler)Main handler logic for the manage_alerts tool within the CallToolRequestSchema handler's switch statement. Dispatches to appropriate client method based on the 'action' parameter (list, create, update, delete).case 'manage_alerts': const { corpName: corpForAlerts, siteName: siteForAlerts } = resolveContext(typedArgs); if (!siteForAlerts) { throw new Error('Site name is required. Please set context or provide siteName parameter.'); } if (typedArgs.action === 'list') { result = await client.listAlerts(corpForAlerts, siteForAlerts); } else if (typedArgs.action === 'create') { const alertData = { tagName: typedArgs.tagName, longName: typedArgs.longName, interval: typedArgs.interval, threshold: typedArgs.threshold, enabled: typedArgs.enabled, action: typedArgs.action_type, }; result = await client.createAlert(corpForAlerts, siteForAlerts, alertData); } else if (typedArgs.action === 'update') { const alertData = { tagName: typedArgs.tagName, longName: typedArgs.longName, interval: typedArgs.interval, threshold: typedArgs.threshold, enabled: typedArgs.enabled, action: typedArgs.action_type, }; result = await client.updateAlert(corpForAlerts, siteForAlerts, typedArgs.alertId, alertData); } else if (typedArgs.action === 'delete') { result = await client.deleteAlert(corpForAlerts, siteForAlerts, typedArgs.alertId); } break;
- server.js:738-758 (schema)Schema definition for the manage_alerts tool, including name, description, and detailed input schema. This is part of the tools array returned by ListToolsRequestSchema.{ name: 'manage_alerts', description: 'Manage alerts for monitoring attack patterns', inputSchema: { type: 'object', properties: { corpName: { type: 'string', description: 'Corporation name (uses context default if not provided)' }, siteName: { type: 'string', description: 'Site name (uses context default if not provided)' }, action: { type: 'string', enum: ['list', 'create', 'update', 'delete'], description: 'Action to perform' }, alertId: { type: 'string', description: 'Alert ID (for update/delete actions)' }, tagName: { type: 'string', description: 'Tag name to monitor' }, longName: { type: 'string', description: 'Alert description' }, interval: { type: 'number', enum: [1, 10, 60], description: 'Time interval in minutes' }, threshold: { type: 'number', description: 'Threshold count' }, enabled: { type: 'boolean', description: 'Whether alert is enabled' }, action_type: { type: 'string', enum: ['info', 'flagged'], description: 'Action when triggered' }, }, required: ['action'], }, }, {
- server.js:246-262 (helper)Helper methods in FastlyNGWAFClient class that implement the core API calls for managing alerts (list, create, update, delete). Called by the main handler.// Alerts Management async listAlerts(corpName, siteName) { const response = await this.api.get(`/corps/${corpName}/sites/${siteName}/alerts`); return response.data; } async createAlert(corpName, siteName, alertData) { const response = await this.api.post(`/corps/${corpName}/sites/${siteName}/alerts`, alertData); return response.data; } async updateAlert(corpName, siteName, alertId, alertData) { const response = await this.api.patch(`/corps/${corpName}/sites/${siteName}/alerts/${alertId}`, alertData); return response.data; } async deleteAlert(corpName, siteName, alertId) { await this.api.delete(`/corps/${corpName}/sites/${siteName}/alerts/${alertId}`); return { success: true }; }
- server.js:387-394 (helper)Helper function used by the handler to resolve corporation and site names from arguments or context.function resolveContext(args) { const corpName = args.corpName || context.defaultCorpName; const siteName = args.siteName || context.defaultSiteName; if (!corpName) { throw new Error('Corporation name is required. Please set context or provide corpName parameter.'); } return { corpName, siteName }; }