Skip to main content
Glama

whmcs_get_servers

Retrieve a list of configured servers from WHMCS, with an option to fetch their current status for management purposes.

Instructions

Get list of configured servers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fetchStatusNoFetch server status

Implementation Reference

  • Core handler implementation: the getServers() method in WhmcsApiClient that calls the WHMCS 'GetServers' API action to retrieve the list of configured servers.
    /** * Get servers */ async getServers(params: { fetchStatus?: boolean; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; servers: { server: Array<{ id: number; name: string; hostname: string; ipaddress: string; assignedips: string; active: boolean; disabled: boolean; type: string; maxaccounts: number; statusaddress: string; ns1: string; ns1ip: string; ns2: string; ns2ip: string; ns3: string; ns3ip: string; ns4: string; ns4ip: string; }> }; }>('GetServers', params); }
  • src/index.ts:871-886 (registration)
    MCP tool registration for 'whmcs_get_servers', including title, description, input schema validation, and thin handler wrapper that invokes whmcsClient.getServers().
    server.registerTool( 'whmcs_get_servers', { title: 'Get Servers', description: 'Get list of configured servers', inputSchema: { fetchStatus: z.boolean().optional().describe('Fetch server status'), }, }, async (params) => { const result = await whmcsClient.getServers(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );
  • Zod input schema definition for the whmcs_get_servers tool parameters.
    inputSchema: { fetchStatus: z.boolean().optional().describe('Fetch server status'), },
  • Registers a read-only resource 'whmcs://servers' that fetches and provides server data using the same getServers method.
    server.registerResource( 'whmcs-servers', 'whmcs://servers', { title: 'Configured Servers', description: 'List of servers configured in WHMCS for service provisioning', mimeType: 'application/json', }, async (uri) => { try { const servers = await whmcsClient.getServers({}); return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(servers, null, 2), }], }; } catch (error) { return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify({ error: 'Failed to fetch servers' }), }], }; } } );

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/scarecr0w12/whmcs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server