get_database
Retrieve database configuration and details using a unique identifier to manage and deploy applications in self-hosted environments.
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 core handler logic for the 'get_database' tool. It requires a 'uuid' parameter and fetches the database details from the Coolify API endpoint `/databases/{uuid}`.case 'get_database': requireParam(args, 'uuid'); return client.get(`/databases/${args.uuid}`);
- src/tools/definitions.ts:1064-1071 (schema)The input schema and description for the 'get_database' tool, defining that it requires a 'uuid' string parameter.name: 'get_database', description: 'Get database details by UUID', inputSchema: { type: 'object', properties: { uuid: { type: 'string', description: 'Database UUID' } }, required: ['uuid'] } },
- src/index.ts:41-67 (registration)MCP server request handler for tool calls (CallToolRequestSchema). Dispatches to handleTool based on tool name, which routes to the get_database case.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/index.ts:36-38 (registration)MCP server request handler for listing tools (ListToolsRequestSchema). Returns all tool definitions from getToolDefinitions(), including get_database.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getToolDefinitions() }));
- src/tools/handlers.ts:504-508 (helper)Helper function used by get_database handler to validate presence of required 'uuid' parameter.function requireParam(args: ToolArgs, param: string): void { if (!args[param]) { throw new McpError(ErrorCode.InvalidParams, `${param} is required`); } }