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 };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions 'monitoring attack patterns' which hints at security context, but doesn't disclose permissions needed, whether operations are destructive, rate limits, or what happens when alerts trigger. For a multi-action tool with potential mutations (create/update/delete), this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that gets straight to the point without unnecessary words. However, it's arguably too brief for a 10-parameter tool with multiple actions, lacking the front-loaded detail needed for such complexity.

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?

For a complex tool with 10 parameters, multiple actions (including destructive ones), no annotations, and no output schema, the description is insufficient. It doesn't explain the tool's scope (corp/site level), what 'managing' entails operationally, or what the expected outcomes are. The agent must rely entirely on the input schema without contextual guidance.

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?

Schema description coverage is 100%, so parameters are well-documented in the schema itself. The description adds no additional parameter context beyond the generic 'manage alerts' statement. It doesn't explain relationships between parameters (e.g., alertId only needed for update/delete) or provide usage examples. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Manage alerts for monitoring attack patterns' states the general purpose (managing alerts) and domain (attack pattern monitoring), but is vague about what 'manage' entails. It doesn't specify the CRUD operations available or differentiate from sibling tools like 'manage_blacklist' or 'manage_whitelist' that also manage security-related items.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'list_events', 'get_suspicious_ips', and various rule management tools, the description doesn't indicate whether this is for alert configuration vs. alert viewing, or when to prefer it over other monitoring tools.

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

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