Skip to main content
Glama
tao12345666333

Civo MCP Server

reboot_instance

Restart a cloud instance on Civo to apply updates or resolve issues. Specify the instance ID and region for targeted operation.

Instructions

Reboot a cloud instance on Civo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInstance ID
regionYesRegion identifier

Implementation Reference

  • Core handler function that makes the POST request to Civo's API to reboot the specified instance.
    export async function rebootInstance(params: {
      id: string;
      region: string;
    }): Promise<any> {
      checkRateLimit();
    
      const url = `${CIVO_API_URL}/instances/${params.id}/reboots`;
      const response = await fetch(url, {
        method: 'POST',
        headers: {
          Authorization: `Bearer ${CIVO_API_KEY}`,
        },
        body: new URLSearchParams({
          region: params.region,
        }),
      });
    
      if (!response.ok) {
        throw new Error(
          `Civo API error: ${response.status} ${response.statusText}`
        );
      }
    
      return response.json();
    }
  • Defines the tool schema, name, description, and input validation schema requiring 'id' and 'region'.
    export const REBOOT_INSTANCE_TOOL: Tool = {
      name: 'reboot_instance',
      description: 'Reboot a cloud instance on Civo',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'Instance ID',
          },
          region: {
            type: 'string',
            description: 'Region identifier',
          },
        },
        required: ['id', 'region'],
      },
    };
  • src/index.ts:73-73 (registration)
    Registers the REBOOT_INSTANCE_TOOL in the MCP server's capabilities.tools dictionary.
    [REBOOT_INSTANCE_TOOL.name]: REBOOT_INSTANCE_TOOL,
  • Server-side dispatcher for 'reboot_instance' tool call: validates arguments and invokes the rebootInstance handler.
    case 'reboot_instance': {
      if (
        typeof args !== 'object' ||
        args === null ||
        typeof args.id !== 'string' ||
        typeof args.region !== 'string'
      ) {
        throw new Error('Invalid arguments for reboot_instance');
      }
    
      const result = await rebootInstance(
        args as { id: string; region: string }
      );
      return {
        content: [
          {
            type: 'text',
            text: `Instance ${args.id} rebooted: ${result.result}`,
          },
        ],
        isError: false,
      };
    }

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