Skip to main content
Glama
moosin76

MariaDB Reader MCP Server

by moosin76

list_databases

List all accessible databases in a MariaDB server to help AI assistants explore and interact with database structures efficiently.

Instructions

접근 가능한 모든 데이터베이스 목록을 보여줍니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the list_databases tool by creating a database connection and running 'SHOW DATABASES' query, then returns the results as formatted JSON text content.
    case "list_databases": {
      connection = await createDbConnection(); // 특정 DB 없이 연결
      const [rows] = await connection.query('SHOW DATABASES;'); // 데이터베이스 목록 조회 쿼리
      // 결과를 JSON 문자열로 변환하여 반환 (가독성을 위해 null, 2 사용)
      return { content: [{ type: "text", text: JSON.stringify(rows, null, 2) }] };
    }
  • src/index.ts:75-79 (registration)
    Registers the list_databases tool in the ListTools response, specifying its name, description, and input schema (empty object, no parameters required).
    {
      name: "list_databases",
      description: "접근 가능한 모든 데이터베이스 목록을 보여줍니다.",
      inputSchema: { type: "object", properties: {} } // 입력 필요 없음
    },
  • Input schema definition for list_databases tool: an empty object with no properties.
      inputSchema: { type: "object", properties: {} } // 입력 필요 없음
    },
  • Helper function to create a MySQL connection for the database, used by the list_databases handler (called without dbName).
    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?

No annotations are provided, so the description carries the full burden. It states the tool shows a list, implying a read-only operation, but does not disclose any behavioral traits such as permissions required, rate limits, pagination, or what 'accessible' entails. The description is minimal and lacks critical operational context.

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, clear sentence that directly states the tool's purpose without unnecessary details. It is appropriately concise and front-loaded, though it could be slightly more informative to improve completeness without sacrificing brevity.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. However, it lacks details on behavioral aspects like what 'accessible' means or how the list is formatted, which would be helpful for an agent. The absence of an output schema means the description should ideally hint at the return format, but it does not.

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

Parameters4/5

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

The tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description does not need to add parameter semantics, so it meets the baseline for tools with no parameters. No additional parameter information is required or provided.

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 a list of all accessible databases). It specifies the verb '보여줍니다' (shows) and the resource '데이터베이스 목록' (database list), but does not explicitly differentiate it from sibling tools like 'list_tables' 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 does not mention any prerequisites, context for usage, or comparisons with sibling tools such as 'list_tables' or 'query_table', leaving the agent to infer usage based on tool names alone.

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