Skip to main content
Glama
tao12345666333

Civo MCP Server

resize_instance

Change the size of a cloud instance on Civo to adjust computing resources like CPU and memory by specifying the instance ID, new size, and region.

Instructions

Resize a cloud instance on Civo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInstance ID
regionYesRegion identifier
sizeYesNew instance size

Implementation Reference

  • The resizeInstance function that executes the core tool logic by calling the Civo API to resize the instance.
    export async function resizeInstance(params: { id: string; size: string; region: string; }): Promise<any> { checkRateLimit(); const url = new URL(`${CIVO_API_URL}/instances/${params.id}/resize`); url.searchParams.set('region', params.region); const response = await fetch(url.toString(), { method: 'PUT', headers: { Authorization: `Bearer ${CIVO_API_KEY}`, }, body: new URLSearchParams({ size: params.size, }), }); if (!response.ok) { throw new Error( `Civo API error: ${response.status} ${response.statusText}` ); } return response.json(); }
  • Tool schema definition including input schema, name, and description for resize_instance.
    export const RESIZE_INSTANCE_TOOL: Tool = { name: 'resize_instance', description: 'Resize a cloud instance on Civo', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Instance ID', }, size: { type: 'string', description: 'New instance size', }, region: { type: 'string', description: 'Region identifier', }, }, required: ['id', 'size', 'region'], }, };
  • src/index.ts:303-326 (registration)
    Dispatch handler in the CallToolRequestSchema that validates arguments and calls resizeInstance for the resize_instance tool.
    case 'resize_instance': { if ( typeof args !== 'object' || args === null || typeof args.id !== 'string' || typeof args.size !== 'string' || typeof args.region !== 'string' ) { throw new Error('Invalid arguments for resize_instance'); } const result = await resizeInstance( args as { id: string; size: string; region: string } ); return { content: [ { type: 'text', text: `Instance ${args.id} resized: ${result.result}`, }, ], isError: false, }; }
  • src/index.ts:76-76 (registration)
    Registration of the resize_instance tool in the server capabilities.tools object.
    [RESIZE_INSTANCE_TOOL.name]: RESIZE_INSTANCE_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