Skip to main content
Glama
moosin76

MariaDB Reader MCP Server

by moosin76

list_tables

Display all tables within a specified MariaDB database to enable exploration and interaction with its structure and content.

Instructions

특정 데이터베이스 내의 모든 테이블 목록을 보여줍니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYes데이터베이스의 이름입니다.

Implementation Reference

  • Executes SHOW TABLES query on the specified database to list all tables and returns the result as JSON.
    case "list_tables": {
      const dbName = args.database as string; // 데이터베이스 이름 추출
      if (!dbName) throw new McpError(ErrorCode.InvalidParams, "필수 파라미터 누락: database");
      connection = await createDbConnection(dbName); // 지정된 DB로 연결
      // 테이블 목록 조회 쿼리 (백틱 사용은 안전하지만 SHOW TABLES에서는 필수는 아님)
      const [rows] = await connection.query(`SHOW TABLES;`);
      return { content: [{ type: "text", text: JSON.stringify(rows, null, 2) }] };
    }
  • src/index.ts:80-90 (registration)
    Registers the list_tables tool, specifying its name, description, and required input schema (database name).
    {
      name: "list_tables",
      description: "특정 데이터베이스 내의 모든 테이블 목록을 보여줍니다.",
      inputSchema: {
        type: "object",
        properties: {
          database: { type: "string", description: "데이터베이스의 이름입니다." }
        },
        required: ["database"]
      }
    },
  • Defines the input schema for list_tables tool, requiring a 'database' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        database: { type: "string", description: "데이터베이스의 이름입니다." }
      },
      required: ["database"]
    }
  • Helper function to create a database connection, used by list_tables and other tools.
    async function createDbConnection(dbName?: string) {
      try {
        const connection = await mysql.createConnection({
          ...dbConfig,
          database: dbName || dbConfig.database, // 특정 DB가 제공되면 사용, 아니면 기본값 사용
        });
        return connection;
      } catch (error: any) {
        console.error("데이터베이스 연결 오류:", error.message);
        // MCP 클라이언트에게 더 구체적인 오류 제공
        throw new McpError(ErrorCode.InternalError, `데이터베이스 연결 실패: ${error.message}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool shows table lists but doesn't describe return format (e.g., array of names, pagination), permissions required, rate limits, or error conditions. This leaves significant gaps for a tool that likely interacts with a database system.

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

Conciseness4/5

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

The description is a single, efficient sentence in Korean that directly states the tool's function. There's no wasted wording, though it could be slightly more structured (e.g., by front-loading the core action more explicitly).

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a database tool. It doesn't explain what the output looks like (e.g., list format, metadata included), error handling, or behavioral constraints. For a tool with one parameter but potentially complex database interactions, more context is needed.

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 schema already documents the single 'database' parameter thoroughly. The description adds no additional parameter semantics beyond implying the tool operates within a database context, which is already clear from the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose4/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: '보여줍니다' (shows/displays) + '모든 테이블 목록' (all table list) + '특정 데이터베이스 내의' (within a specific database). It specifies the verb (show/list), resource (tables), and scope (within a database), though it doesn't explicitly differentiate from sibling tools like 'list_databases' or 'get_table_schema'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_databases' (for listing databases instead of tables) or 'get_table_schema' (for detailed table info), nor does it specify prerequisites or exclusions for usage.

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

Related 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/moosin76/mcp_server_mariadb_reader'

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