Skip to main content
Glama
purpleax

Fastly NGWAF MCP Server

by purpleax

create_corp_rule

Create corporation-level security rules for Fastly's Next-Gen WAF to protect web applications by defining conditions and actions.

Instructions

Create a corporation-level rule

Input Schema

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

Implementation Reference

  • MCP tool handler implementation for 'create_corp_rule': resolves corporation name from context or arguments, builds rule data object from input, and calls the client helper to execute the API call.
    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;
  • FastlyNGWAFClient helper method that performs the HTTP POST request to the Fastly NGWAF API endpoint for creating a corporation-level rule.
    async createCorpRule(corpName, ruleData) {
        const response = await this.api.post(`/corps/${corpName}/rules`, ruleData);
        return response.data;
  • Input schema for the 'create_corp_rule' tool, defining parameters such as type, conditions, actions, and optional fields like corpScope and siteNames.
    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 registration object for 'create_corp_rule' in the tools array, which is returned by the ListTools handler to advertise the tool's availability, description, and schema.
    {
        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'],
        },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'create' which implies a write/mutation operation, but doesn't mention permissions needed, whether creation is idempotent, error conditions, or what happens on success (e.g., returns rule ID). For a creation tool with 10 parameters, this leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is a single, efficient sentence with no wasted words. It's appropriately sized for a tool with good schema documentation. Every word earns its place by stating the core action and scope.

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 creation tool with 10 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after creation (return value), error handling, or how this tool fits into the broader rule management workflow with siblings like 'list_corp_rules' and 'delete_corp_rule'. The schema covers parameters well, but behavioral context is lacking.

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 the schema already documents all 10 parameters thoroughly with descriptions and enums. The description adds no additional parameter context beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting, though the description could have explained parameter relationships or dependencies.

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 states the action ('create') and resource ('corporation-level rule'), which provides basic purpose. However, it doesn't specify what a 'corporation-level rule' entails or how it differs from sibling tools like 'create_site_rule' or 'list_corp_rules'. The purpose is clear but lacks differentiation from related tools.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create_site_rule' or 'list_corp_rules'. There's no mention of prerequisites, appropriate contexts, or exclusions. The agent must infer usage from the tool name and schema alone.

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