Skip to main content
Glama

get_database

Retrieve database configuration and connection details using a unique identifier to manage and access Coolify PaaS database resources.

Instructions

Get database details by UUID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesDatabase UUID

Implementation Reference

  • The handler logic for the 'get_database' tool. It requires a 'uuid' parameter and fetches the database details from the Coolify API endpoint `/databases/{uuid}` using the CoolifyClient.
    case 'get_database':
      requireParam(args, 'uuid');
      return client.get(`/databases/${args.uuid}`);
  • The schema definition for the 'get_database' tool, specifying the input parameters and description used for MCP tool registration and validation.
    {
      name: 'get_database',
      description: 'Get database details by UUID',
      inputSchema: {
        type: 'object',
        properties: { uuid: { type: 'string', description: 'Database UUID' } },
        required: ['uuid']
      }
    },
  • src/index.ts:36-38 (registration)
    The MCP server registers all tools, including 'get_database', by providing the tool definitions from getToolDefinitions() in response to ListToolsRequest.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: getToolDefinitions()
    }));
  • src/index.ts:41-67 (registration)
    The MCP server handles tool calls by dispatching to handleTool, which routes 'get_database' to its specific case handler.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      if (!this.client) {
        throw new McpError(ErrorCode.InternalError, 'Client not initialized');
      }
    
      const { name, arguments: args } = request.params;
    
      // Block write operations in read-only mode
      if (isReadOnlyMode() && !READ_ONLY_TOOLS.includes(name)) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          `Operation '${name}' is not allowed in read-only mode. Set COOLIFY_READONLY=false to enable write operations.`
        );
      }
    
      try {
        const result = await handleTool(this.client, name, args || {});
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
        };
      } catch (error) {
        if (error instanceof McpError) throw error;
        
        const message = error instanceof Error ? error.message : 'Unknown error';
        throw new McpError(ErrorCode.InternalError, `Tool execution failed: ${message}`);
      }
    });
  • 'get_database' is listed as a read-only tool, ensuring it is available even in read-only mode.
    'get_database',
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