list_regions
Retrieve a list of available cloud regions on Civo to determine where you can 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)Executes the list_regions tool by calling the listRegions API function and formatting the list of regions into a text response.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)Defines the input schema and metadata for the list_regions tool (no input 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 MCP server capabilities.tools dictionary.[LIST_REGIONS_TOOL.name]: LIST_REGIONS_TOOL,
- src/api/regions.ts:11-25 (helper)Core API function that fetches the list of regions from Civo API, called by the tool handler.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(); }