list_sizes
List available instance sizes on Civo for selecting compute resources when provisioning instances.
Instructions
List available instance sizes on Civo
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:328-343 (handler)The tool handler for 'list_sizes': calls listSizes() API function and formats the output with size name and description.
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/api/sizes.ts:13-27 (handler)The API function listSizes() that fetches sizes from the Civo API endpoint /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/tools/sizes.ts:3-10 (schema)Tool definition/schema for 'list_sizes' with name, description, and empty inputSchema.
export const LIST_SIZES_TOOL: Tool = { name: 'list_sizes', description: 'List available instance sizes on Civo', inputSchema: { type: 'object', properties: {}, }, }; - src/index.ts:80-80 (registration)Registration of LIST_SIZES_TOOL in the server's tools capabilities.
[LIST_SIZES_TOOL.name]: LIST_SIZES_TOOL, - src/index.ts:107-107 (registration)Registration of LIST_SIZES_TOOL in the ListTools response.
LIST_SIZES_TOOL,