Skip to main content
Glama
purpleax

Fastly NGWAF MCP Server

by purpleax

create_corp_rule

Define and implement corporation-level rules for Fastly NGWAF by specifying conditions, actions, and scope to enhance web application security and manage traffic effectively.

Instructions

Create a corporation-level rule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionsYesRule actions
conditionsYesRule conditions
corpNameNoCorporation name (uses context default if not provided)
corpScopeNoRule scope
enabledNoWhether rule is enabled
groupOperatorYesCondition group operator
reasonNoDescription of the rule
signalNoSignal ID for exclusion rules
siteNamesNoSite names for specific scope
typeYesRule type

Implementation Reference

  • Handler logic in the main request handler switch statement that processes arguments, resolves context, builds the rule payload, and calls the client method to create the corp rule.
    case 'create_corp_rule': const { corpName: corpForCorpRule } = resolveContext(typedArgs); const corpRuleData = { type: typedArgs.type, enabled: typedArgs.enabled, groupOperator: typedArgs.groupOperator, conditions: typedArgs.conditions, actions: typedArgs.actions, reason: typedArgs.reason, signal: typedArgs.signal, corpScope: typedArgs.corpScope, siteNames: typedArgs.siteNames, }; result = await client.createCorpRule(corpForCorpRule, corpRuleData); break;
  • Input schema defining parameters and validation for the create_corp_rule tool.
    inputSchema: { type: 'object', properties: { corpName: { type: 'string', description: 'Corporation name (uses context default if not provided)' }, type: { type: 'string', enum: ['request', 'signal'], description: 'Rule type' }, enabled: { type: 'boolean', description: 'Whether rule is enabled' }, groupOperator: { type: 'string', enum: ['all', 'any'], description: 'Condition group operator' }, conditions: { type: 'array', description: 'Rule conditions' }, actions: { type: 'array', description: 'Rule actions' }, reason: { type: 'string', description: 'Description of the rule' }, signal: { type: 'string', description: 'Signal ID for exclusion rules' }, corpScope: { type: 'string', enum: ['global', 'specificSites'], description: 'Rule scope' }, siteNames: { type: 'array', items: { type: 'string' }, description: 'Site names for specific scope' }, }, required: ['type', 'groupOperator', 'conditions', 'actions'], },
  • server.js:562-581 (registration)
    Tool definition object added to the tools list, which is returned by ListToolsRequestHandler, effectively registering the tool.
    { name: 'create_corp_rule', description: 'Create a corporation-level rule', inputSchema: { type: 'object', properties: { corpName: { type: 'string', description: 'Corporation name (uses context default if not provided)' }, type: { type: 'string', enum: ['request', 'signal'], description: 'Rule type' }, enabled: { type: 'boolean', description: 'Whether rule is enabled' }, groupOperator: { type: 'string', enum: ['all', 'any'], description: 'Condition group operator' }, conditions: { type: 'array', description: 'Rule conditions' }, actions: { type: 'array', description: 'Rule actions' }, reason: { type: 'string', description: 'Description of the rule' }, signal: { type: 'string', description: 'Signal ID for exclusion rules' }, corpScope: { type: 'string', enum: ['global', 'specificSites'], description: 'Rule scope' }, siteNames: { type: 'array', items: { type: 'string' }, description: 'Site names for specific scope' }, }, required: ['type', 'groupOperator', 'conditions', 'actions'], }, },
  • Helper method in FastlyNGWAFClient class that performs the actual API POST request to create a corporation rule.
    async createCorpRule(corpName, ruleData) { const response = await this.api.post(`/corps/${corpName}/rules`, ruleData); return response.data; }

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