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

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

With no annotations provided, the description carries the full burden. It states what the tool does (test connection, validate credentials) but doesn't disclose behavioral traits like what happens on failure, whether it makes actual API calls, rate limits, or what the output looks like. It's adequate but lacks operational details.

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 perfectly concise at 6 words, front-loading the core purpose with zero wasted words. Every element ('test', 'API connection', 'validate credentials') earns its place by contributing essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema) and lack of annotations, the description is complete enough to understand the basic purpose. However, for a credential validation tool, additional context about what constitutes success/failure or security implications would be helpful, especially with no output schema to clarify return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the lack of inputs. The description doesn't need to add parameter information, and it appropriately focuses on the tool's purpose rather than repeating the obvious absence of parameters.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('test', 'validate') and resources ('API connection', 'credentials'), making it immediately understandable. It distinguishes itself from all sibling tools, which perform CRUD operations on various resources rather than connection testing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context (testing API connectivity and credential validation), which is clear for this type of diagnostic tool. However, it doesn't explicitly state when NOT to use it or mention alternatives (e.g., whether other tools might also validate credentials indirectly).

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