Skip to main content
Glama
purpleax

Fastly NGWAF MCP Server

by purpleax

test_connection

Verify API connectivity and validate credentials for the Fastly Next-Gen Web Application Firewall integration.

Instructions

Test the API connection and validate credentials

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP server request handler for the 'test_connection' tool. Validates client existence and delegates to the client's testConnection method.
    case 'test_connection':
        if (!client) {
            throw new Error('Please set credentials first using the set_credentials tool.');
        }
        result = await client.testConnection();
        break;
  • Core logic for testing API connection in FastlyNGWAFClient class by fetching /corps endpoint and handling auth errors.
        try {
            const response = await this.api.get('/corps');
            return {
                success: true,
                authenticated: true,
                corporationsCount: response.data.data?.length || 0,
                email: this.email
            };
        }
        catch (error) {
            if (error.response?.status === 401) {
                throw new Error('Invalid email or API token. Please check your credentials.');
            }
            throw new Error(`API connection failed: ${error.response?.data?.message || error.message}`);
        }
    }
  • Input schema definition for the test_connection tool in the tools registry array. No required parameters.
        name: 'test_connection',
        description: 'Test the API connection and validate credentials',
        inputSchema: {
            type: 'object',
            properties: {},
        },
    },
    {
  • server.js:814-816 (registration)
    Tool registration handler that lists all available tools, including test_connection, via the 'tools' array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
        return { 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