Skip to main content
Glama
MikelA92

Metabase MCP Server

by MikelA92

get_database

Retrieve database details including engine type and connection information by ID to understand data sources for Metabase cards.

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 main handler function that executes the get_database tool. It validates the databaseId, fetches database details from the Metabase API, and returns formatted text content with key database information.
      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 for validating the databaseId parameter.
    {
      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'],
      },
    },
  • The registration/dispatch point in the MCP server's executeTool switch statement that maps the tool name to the handler method.
    case 'get_database':
      return await this.databaseHandlers.getDatabase(args.databaseId);
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Since no annotations are provided, the description carries the full burden of behavioral disclosure. It effectively communicates that this is a 'read-only operation' with 'Risk: None', and specifies the type of information returned ('engine type and connection details'), which is valuable context beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with three concise sentences that each add value: stating the purpose, providing usage context, and disclosing behavioral traits. There is no wasted text or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only tool with one parameter and no output schema, the description is largely complete. It covers purpose, usage, and safety, though it could slightly enhance completeness by hinting at the return format (e.g., structured data vs. raw details) given the lack of output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema already documents the 'databaseId' parameter thoroughly. The description does not add any additional meaning or context about the parameter beyond what the schema provides, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Get database information') and resources ('by ID including engine type and connection details'), and distinguishes it from siblings like 'list_databases' by focusing on individual database retrieval rather than listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('Use this to understand which database a card connects to'), but does not explicitly mention when not to use it or name specific alternatives among the many sibling tools available.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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