get_database
Retrieve database information including engine type and connection details by ID to understand which database a Metabase card connects to.
Instructions
🗄️ [SAFE] Get database information by ID including engine type and connection details. Use this to understand which database a card connects to. Risk: None - read-only operation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| databaseId | Yes | The ID of the database to retrieve |
Implementation Reference
- The core handler function for the 'get_database' tool. Fetches database information from the Metabase API using the provided databaseId and returns formatted text content with key details like ID, name, engine, description, and timestamps.async getDatabase(databaseId) { Validators.validateDatabaseId(databaseId); this.logger.debug('Getting database', { databaseId }); const database = await this.apiClient.makeRequest(`/api/database/${databaseId}`); return { content: [ { type: 'text', text: `Database Information: ID: ${database.id} Name: ${database.name} Engine: ${database.engine} Description: ${database.description || 'No description'} Created: ${database.created_at} Updated: ${database.updated_at}`, }, ], }; }
- The tool schema definition including name, description, and inputSchema requiring a positive integer 'databaseId'.{ name: 'get_database', description: '🗄️ [SAFE] Get database information by ID including engine type and connection details. Use this to understand which database a card connects to. Risk: None - read-only operation.', inputSchema: { type: 'object', properties: { databaseId: { type: 'integer', description: 'The ID of the database to retrieve', minimum: 1, }, }, required: ['databaseId'], }, },
- src/server/MetabaseMCPServer.js:188-189 (registration)Registration in the tool execution switch statement, dispatching calls to the databaseHandlers.getDatabase method.case 'get_database': return await this.databaseHandlers.getDatabase(args.databaseId);