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
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | Database UUID |
Implementation Reference
- src/tools/handlers.ts:391-393 (handler)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}`);
- src/tools/definitions.ts:1063-1071 (schema)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}`); } });
- src/tools/definitions.ts:30-30 (helper)'get_database' is listed as a read-only tool, ensuring it is available even in read-only mode.'get_database',