Skip to main content
Glama
MikelA92
by MikelA92

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
NameRequiredDescriptionDefault
databaseIdYesThe 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'], }, },
  • Registration in the tool execution switch statement, dispatching calls to the databaseHandlers.getDatabase method.
    case 'get_database': return await this.databaseHandlers.getDatabase(args.databaseId);

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/MikelA92/metabase-mcp-mab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server