Skip to main content
Glama
purpleax

Fastly NGWAF MCP Server

by purpleax

discover_environment

Identify available corporations and sites for authenticated users, enabling exploration of specific environments within the Fastly NGWAF MCP Server.

Instructions

Discover available corporations and sites for the authenticated user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
corpNameNoSpecific corporation to explore (optional)

Implementation Reference

  • The core handler logic for the 'discover_environment' tool within the CallToolRequestSchema handler's switch statement. It checks if corpName is provided; if yes, lists sites for that corp using client.listSites(); otherwise, lists all accessible corporations using client.listCorps().
    case 'discover_environment': if (typedArgs.corpName) { const { corpName } = resolveContext(typedArgs); const sites = await client.listSites(corpName); result = { corporation: corpName, sites }; } else { const corps = await client.listCorps(); result = { corporations: corps }; } break;
  • Input schema definition for the 'discover_environment' tool, specifying an optional corpName parameter.
    inputSchema: { type: 'object', properties: { corpName: { type: 'string', description: 'Specific corporation to explore (optional)' }, }, },
  • server.js:438-446 (registration)
    Tool registration object added to the 'tools' array, which is returned by the ListToolsRequestSchema handler, declaring the tool's name, description, and input schema.
    name: 'discover_environment', description: 'Discover available corporations and sites for the authenticated user', inputSchema: { type: 'object', properties: { corpName: { type: 'string', description: 'Specific corporation to explore (optional)' }, }, }, },
  • Helper function 'resolveContext' used in the handler to derive corpName from arguments or global context.
    function resolveContext(args) { const corpName = args.corpName || context.defaultCorpName; const siteName = args.siteName || context.defaultSiteName; if (!corpName) { throw new Error('Corporation name is required. Please set context or provide corpName parameter.'); } return { corpName, siteName }; }
  • FastlyNGWAFClient.listCorps() method invoked by the handler to fetch list of corporations when no specific corpName is provided.
    async listCorps() { const response = await this.api.get('/corps'); 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