list_sizes
Retrieve available instance sizes on Civo cloud platform to select appropriate compute resources for your cloud infrastructure needs.
Instructions
List available instance sizes on Civo
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:328-343 (handler)MCP server handler for the 'list_sizes' tool call. Invokes the listSizes API function, formats the sizes into a text list, and returns it in the expected MCP response format.case 'list_sizes': { const sizes = await listSizes(); const sizeList = sizes .map((s: any) => `${s.name} - ${s.description}`) .join('\n'); return { content: [ { type: 'text', text: `Available Sizes:\n${sizeList}`, }, ], isError: false, }; }
- src/tools/sizes.ts:3-10 (schema)Tool definition including name, description, and input schema (empty object since no parameters are required). Used for MCP tool listing and validation.export const LIST_SIZES_TOOL: Tool = { name: 'list_sizes', description: 'List available instance sizes on Civo', inputSchema: { type: 'object', properties: {}, }, };
- src/api/sizes.ts:13-27 (helper)Core API helper function that performs the HTTP request to Civo's sizes endpoint to retrieve available instance sizes.export async function listSizes(): Promise<Size[]> { const url = `${CIVO_API_URL}/sizes`; const response = await fetch(url, { headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${CIVO_API_KEY}`, }, }); if (!response.ok) { throw new Error(`Failed to list sizes: ${response.statusText}`); } return await response.json(); }
- src/index.ts:80-80 (registration)Registers the list_sizes tool in the MCP server's capabilities.tools dictionary.[LIST_SIZES_TOOL.name]: LIST_SIZES_TOOL,
- src/index.ts:107-107 (registration)Includes the list_sizes tool in the response to ListToolsRequest.LIST_SIZES_TOOL,