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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:861-866 (handler)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;
- server.js:33-48 (helper)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}`); } }
- server.js:410-417 (schema)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 }; });