Skip to main content
Glama
pickstar-2002

MySQL MCP Server

mysql_disconnect

Terminate active MySQL database connections to free up server resources and ensure proper session management when database operations are complete.

Instructions

断开 MySQL 数据库连接

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/server.ts:55-62 (registration)
    Registration of the 'mysql_disconnect' tool in the ListTools response, including name, description, and empty input schema.
    {
      name: 'mysql_disconnect',
      description: '断开 MySQL 数据库连接',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • The main handler function for the mysql_disconnect tool, which delegates to DatabaseManager.disconnect() and returns a success message.
    private async handleDisconnect(): Promise<any> {
      await this.dbManager.disconnect();
      
      return {
        content: [
          {
            type: 'text',
            text: '已断开 MySQL 连接',
          },
        ],
      };
    }
  • The DatabaseManager.disconnect() helper method that ends the MySQL connection pool.
    async disconnect(): Promise<void> {
      if (this.pool) {
        await this.pool.end();
        this.pool = null;
        console.log('已断开 MySQL 连接');
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action (disconnect) but doesn't disclose behavioral traits like whether it's idempotent, if it requires specific permissions, what happens to pending transactions, or if it closes all connections or just the current session. For a mutation tool with zero annotation coverage, this is inadequate.

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 a single, efficient sentence in Chinese that directly states the tool's purpose with zero waste. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 the tool's complexity (a mutation operation to disconnect from a database), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, error conditions, or side effects, leaving significant gaps for an agent to understand its behavior fully.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. Baseline is 4 for zero parameters, as the schema fully covers the absence of inputs.

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 '断开 MySQL 数据库连接' clearly states the action (断开/disconnect) and target resource (MySQL 数据库连接/MySQL database connection). It distinguishes from siblings like mysql_connect (connect) and mysql_query (query), but doesn't specify what exactly gets disconnected (e.g., current session vs all connections).

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?

No guidance on when to use this tool versus alternatives is provided. It doesn't mention prerequisites (e.g., must be connected first), timing considerations, or what happens if called without an active connection. The description alone gives no usage context.

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/pickstar-2002/mysql-mcp'

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