Skip to main content
Glama
purpleax

Fastly NGWAF MCP Server

by purpleax

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
NameRequiredDescriptionDefault
corpNameNoCorporation name (uses context default if not provided)
siteNameNoSite name (uses context default if not provided)
actionYesAction to perform
alertIdNoAlert ID (for update/delete actions)
tagNameNoTag name to monitor
longNameNoAlert description
intervalNoTime interval in minutes
thresholdNoThreshold count
enabledNoWhether alert is enabled
action_typeNoAction when triggered

Implementation Reference

  • 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;
  • 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'], }, }, {
  • 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 }; }
  • 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 }; }

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/purpleax/FastlyMCP'

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