Skip to main content
Glama

create_database

Create new databases for applications by specifying name, type, and deployment environment. Supports PostgreSQL, MySQL, MongoDB, Redis, and other database systems.

Instructions

Create a new database. Valid types: postgresql, mysql, mariadb, mongodb, redis, clickhouse, dragonfly, keydb

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDatabase name
typeYesDatabase type (postgresql, mysql, mariadb, mongodb, redis, clickhouse, dragonfly, keydb)
project_uuidYesProject UUID
environment_nameYesEnvironment name
server_uuidYesServer UUID

Implementation Reference

  • The main handler logic for the 'create_database' tool. Validates required parameters, determines the appropriate Coolify API endpoint based on database type, validates the type, and sends a POST request to create the database.
    case 'create_database':
      requireParam(args, 'name');
      requireParam(args, 'type');
      requireParam(args, 'project_uuid');
      requireParam(args, 'environment_name');
      requireParam(args, 'server_uuid');
      // Coolify uses type-specific endpoints for database creation
      const dbType = String(args.type).toLowerCase();
      const validTypes: Record<string, string> = {
        'postgresql': '/databases/postgresql',
        'mysql': '/databases/mysql',
        'mariadb': '/databases/mariadb',
        'mongodb': '/databases/mongodb',
        'redis': '/databases/redis',
        'clickhouse': '/databases/clickhouse',
        'dragonfly': '/databases/dragonfly',
        'keydb': '/databases/keydb'
      };
      const endpoint = validTypes[dbType];
      if (!endpoint) {
        throw new McpError(ErrorCode.InvalidParams, `Invalid database type: ${dbType}. Valid types are: ${Object.keys(validTypes).join(', ')}`);
      }
      return client.post(endpoint, args);
  • Tool definition including name, description, and JSON input schema for MCP tool registration and validation.
    name: 'create_database',
    description: 'Create a new database. Valid types: postgresql, mysql, mariadb, mongodb, redis, clickhouse, dragonfly, keydb',
    inputSchema: {
      type: 'object',
      properties: {
        name: { type: 'string', description: 'Database name' },
        type: { type: 'string', description: 'Database type (postgresql, mysql, mariadb, mongodb, redis, clickhouse, dragonfly, keydb)' },
        project_uuid: { type: 'string', description: 'Project UUID' },
        environment_name: { type: 'string', description: 'Environment name' },
        server_uuid: { type: 'string', description: 'Server UUID' }
      },
      required: ['name', 'type', 'project_uuid', 'environment_name', 'server_uuid']
    }
  • TypeScript interface defining the input structure for create_database, matching the tool schema.
    export interface CreateDatabaseInput {
      name: string;
      type: string;
      project_uuid: string;
      environment_name: string;
      server_uuid: string;
    }
  • Function that exports all tool definitions (including create_database) for MCP server registration, with optional read-only filtering.
    export function getToolDefinitions() {
      if (isReadOnlyMode()) {
        return allToolDefinitions.filter(tool => READ_ONLY_TOOLS.includes(tool.name));
      }
      return allToolDefinitions;
    }
Install Server

Other Tools

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/kof70/coolify-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server