Skip to main content
Glama
tao12345666333

Civo MCP Server

create_network

Create a new network on the Civo cloud platform by specifying a label and optional region for organizing cloud resources.

Instructions

Create a new network on Civo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYesNetwork label
regionNoRegion identifier

Implementation Reference

  • Handler for the 'create_network' tool: validates input arguments, calls the createNetwork API function, and returns a success message with the created network details.
    case 'create_network': { if ( typeof args !== 'object' || args === null || typeof args.label !== 'string' ) { throw new Error('Invalid arguments for create_network'); } const network = await createNetwork( args as { label: string; region?: string } ); return { content: [ { type: 'text', text: `Created network ${network.label} (ID: ${network.id})`, }, ], isError: false, }; }
  • Schema definition for the 'create_network' tool, including input schema with required 'label' and optional 'region'.
    export const CREATE_NETWORK_TOOL: Tool = { name: 'create_network', description: 'Create a new network on Civo', inputSchema: { type: 'object', properties: { label: { type: 'string', description: 'Network label', }, region: { type: 'string', description: 'Region identifier', }, }, required: ['label'], }, };
  • Helper function that performs the actual API call to Civo to create a network using POST request.
    export async function createNetwork(params: { label: string; region?: string; }): Promise<any> { const url = `${CIVO_API_URL}/networks`; const response = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${CIVO_API_KEY}`, }, body: JSON.stringify(params), }); if (!response.ok) { throw new Error(`Failed to create network: ${response.statusText}`); } return await response.json(); }
  • src/index.ts:83-83 (registration)
    Registration of the 'create_network' tool in the server capabilities.tools dictionary.
    [CREATE_NETWORK_TOOL.name]: CREATE_NETWORK_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