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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:345-360 (handler)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, }; }
- src/tools/regions.ts:3-10 (schema)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,
- src/api/regions.ts:11-25 (helper)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,