Skip to main content
Glama
tao12345666333

Civo MCP Server

list_regions

Retrieve available cloud regions on Civo to deploy instances, networks, and Kubernetes clusters.

Instructions

List available regions on Civo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'list_regions': calls listRegions API function and formats the response as text content.
    case 'list_regions': {
      const regions = await listRegions();
      const regionList = regions
        .map((r: any) => `${r.name} (${r.code})`)
        .join('\n');
    
      return {
        content: [
          {
            type: 'text',
            text: `Available Regions:\n${regionList}`,
          },
        ],
        isError: false,
      };
    }
  • Tool schema definition including name, description, and empty input schema (no parameters required).
    export const LIST_REGIONS_TOOL: Tool = {
      name: 'list_regions',
      description: 'List available regions on Civo',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    };
  • src/index.ts:81-81 (registration)
    Registers the list_regions tool in the server's capabilities.tools map.
    [LIST_REGIONS_TOOL.name]: LIST_REGIONS_TOOL,
  • Core helper function that performs the HTTP request to Civo API to retrieve the list of regions.
    export async function listRegions(): Promise<Region[]> {
      const url = `${CIVO_API_URL}/regions`;
      const response = await fetch(url, {
        headers: {
          'Content-Type': 'application/json',
          Authorization: `Bearer ${CIVO_API_KEY}`,
        },
      });
    
      if (!response.ok) {
        throw new Error(`Failed to list regions: ${response.statusText}`);
      }
    
      return await response.json();
    }
  • src/index.ts:108-108 (registration)
    Includes the list_regions tool in the ListTools response.
    LIST_REGIONS_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