Skip to main content
Glama
tao12345666333

Civo MCP Server

list_networks

Retrieve available cloud networks on the Civo platform to manage infrastructure connectivity and configurations.

Instructions

List available networks on Civo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Defines the tool schema for 'list_networks' including name, description, and empty input schema.
    export const LIST_NETWORKS_TOOL: Tool = {
      name: 'list_networks',
      description: 'List available networks on Civo',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    };
  • Executes the 'list_networks' tool: calls listNetworks(), formats the network list into a text response, and returns it.
    case 'list_networks': {
      const networks = await listNetworks();
      const networkList = networks
        .map((n: any) => `${n.name} (${n.id}) - ${n.label}`)
        .join('\n');
    
      return {
        content: [
          {
            type: 'text',
            text: `Available Networks:\n${networkList}`,
          },
        ],
        isError: false,
      };
    }
  • Helper function that makes the API call to Civo to retrieve the list of networks.
    export async function listNetworks(): Promise<Network[]> {
      const url = `${CIVO_API_URL}/networks`;
      const response = await fetch(url, {
        headers: {
          'Content-Type': 'application/json',
          Authorization: `Bearer ${CIVO_API_KEY}`,
        },
      });
    
      if (!response.ok) {
        throw new Error(`Failed to list networks: ${response.statusText}`);
      }
    
      return await response.json();
    }
  • src/index.ts:82-82 (registration)
    Registers the LIST_NETWORKS_TOOL in the server's capabilities.tools dictionary.
    [LIST_NETWORKS_TOOL.name]: LIST_NETWORKS_TOOL,

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/tao12345666333/civo-mcp'

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