list_databases
Retrieve all connected data sources in Metabase to identify available databases for querying and analysis.
Instructions
🗄️ [SAFE] List all available databases. Use this to see what data sources are connected to Metabase. Risk: None - read-only operation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The core handler function for the 'list_databases' tool. Fetches the list of databases from the Metabase API (/api/database/) and formats them into a readable text response with ID, name, and engine for each database.async listDatabases() { this.logger.debug('Listing databases'); const response = await this.apiClient.makeRequest('/api/database/'); const databases = Array.isArray(response) ? response : response.data || []; return { content: [ { type: 'text', text: `Available Databases (${databases.length}): ${databases.map(db => `- ID: ${db.id} | Name: ${db.name} | Engine: ${db.engine}` ).join('\n')}`, }, ], }; }
- Defines the tool schema including name, description, and empty input schema (no parameters required). Used by the MCP server for tool listing and validation.name: 'list_databases', description: '🗄️ [SAFE] List all available databases. Use this to see what data sources are connected to Metabase. Risk: None - read-only operation.', inputSchema: { type: 'object', properties: {}, }, },
- src/server/MetabaseMCPServer.js:190-191 (registration)Registers and dispatches the 'list_databases' tool call to the appropriate handler method in the main executeTool switch statement.case 'list_databases': return await this.databaseHandlers.listDatabases();