Skip to main content
Glama

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
NameRequiredDescriptionDefault
uuidYesDatabase UUID

Implementation Reference

  • 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}`);
  • 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() }));
  • 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`); } }

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