Skip to main content
Glama
MikelA92

Metabase MCP Server

by MikelA92

list_database_tables

Retrieve all tables from a specific database to identify available data before executing queries. This read-only operation helps users explore database structure.

Instructions

📑 [SAFE] List all tables in a specific database. Use this to see what tables are available before querying. Risk: None - read-only operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseIdYesThe ID of the database

Implementation Reference

  • The handler function that implements the list_database_tables tool logic, fetching database metadata and formatting the list of tables.
      /**
       * List database tables
       */
      async listDatabaseTables(databaseId) {
        Validators.validateDatabaseId(databaseId);
        
        this.logger.debug('Listing database tables', { databaseId });
        // Use metadata endpoint as /tables endpoint doesn't exist
        const metadata = await this.apiClient.makeRequest(`/api/database/${databaseId}/metadata`);
        const tables = metadata.tables || [];
        
        return {
          content: [
            {
              type: 'text',
              text: `Tables in Database ${databaseId}:
    ${tables.map(t => 
      `- ID: ${t.id} | Schema: ${t.schema} | Name: ${t.name}`
    ).join('\n')}`,
            },
          ],
        };
      }
  • The JSON schema definition for the tool, specifying the input parameters (databaseId).
    {
      name: 'list_database_tables',
      description: '📑 [SAFE] List all tables in a specific database. Use this to see what tables are available before querying. Risk: None - read-only operation.',
      inputSchema: {
        type: 'object',
        properties: {
          databaseId: {
            type: 'integer',
            description: 'The ID of the database',
            minimum: 1,
          },
        },
        required: ['databaseId'],
      },
    },
  • The tool registration in the MCP server's executeTool switch statement, dispatching to the handler.
    case 'list_database_tables':
      return await this.databaseHandlers.listDatabaseTables(args.databaseId);
Behavior4/5

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

With no annotations provided, the description carries the full burden and does so well by disclosing key behavioral traits: it's read-only (stated explicitly) and has no risk. However, it lacks details on output format, pagination, or error handling, which would be needed for a perfect score in this context.

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 front-loaded with the core purpose, followed by usage guidance and risk information in just two sentences. Every element (emoji, safety tag, risk note) adds value without waste, making it highly efficient and well-structured.

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?

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is nearly complete: it covers purpose, usage, and safety. It lacks details on return values (e.g., table structure or format), but for a simple list tool, this is a minor gap, not critical.

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?

Schema description coverage is 100%, so the input schema already fully documents the single parameter (databaseId). The description does not add any meaning beyond what the schema provides (e.g., it doesn't explain databaseId further), resulting in a baseline score of 3.

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 specific action ('List all tables') and resource ('in a specific database'), distinguishing it from sibling tools like list_databases (which lists databases) or list_cards (which lists cards). The inclusion of the emoji and '[SAFE]' tag enhances clarity without being redundant.

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

Usage Guidelines5/5

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

It explicitly states when to use this tool ('to see what tables are available before querying'), providing clear context for its purpose. This helps differentiate it from query-execution siblings like execute_card_query or execute_native_query, guiding the agent on preparatory vs. operational use.

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