Skip to main content
Glama
NakiriYuuzu

MSSQL MCP Server

by NakiriYuuzu

disconnect

Terminates active database connections on MSSQL MCP Server, ensuring secure session closure and efficient resource management for Microsoft SQL Server environments.

Instructions

斷開資料庫連接

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'disconnect' MCP tool. It calls the MSSQLManager.disconnect() method and returns a success or error text message.
    async () => {
      try {
        await mssqlManager.disconnect()
        
        return {
          content: [
            {
              type: 'text' as const,
              text: '已成功斷開資料庫連接。'
            }
          ]
        }
      } catch (error) {
        return {
          content: [
            {
              type: 'text' as const,
              text: `斷開連接失敗: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        }
      }
    }
  • src/index.ts:478-507 (registration)
    Registration of the 'disconnect' tool using server.registerTool(), including title, description (schema metadata), and the handler function.
    server.registerTool(
      'disconnect',
      {
        title: '斷開連接',
        description: '斷開資料庫連接'
      },
      async () => {
        try {
          await mssqlManager.disconnect()
          
          return {
            content: [
              {
                type: 'text' as const,
                text: '已成功斷開資料庫連接。'
              }
            ]
          }
        } catch (error) {
          return {
            content: [
              {
                type: 'text' as const,
                text: `斷開連接失敗: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          }
        }
      }
    )
  • The MSSQLManager class method that actually disconnects by closing the SQL connection pool. Called by the tool handler.
    async disconnect(): Promise<void> {
      if (this.pool) {
        await this.pool.close()
        this.pool = null
        console.log('已斷開資料庫連接')
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. '斷開資料庫連接' implies a destructive operation that terminates a connection, but it doesn't specify whether this requires an active connection first, what happens to pending queries, or if the operation is reversible. For a potentially destructive tool with zero annotation coverage, this is insufficient.

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 phrase ('斷開資料庫連接') that directly states the tool's purpose with zero wasted words. It's appropriately sized and front-loaded for a simple, parameterless operation.

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), the description is minimally adequate. However, as a potentially destructive operation with no annotations, it should ideally mention prerequisites (e.g., requires an active connection) or effects. The absence of output schema isn't critical here since the action is straightforward.

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 with 100% schema description coverage, so the schema fully documents the absence of parameters. The description doesn't need to add parameter information, and the baseline for 0 parameters is 4. No additional semantic value 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 '斷開資料庫連接' (Disconnect database connection) clearly states the action (disconnect) and target (database connection), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'connect-database' or 'connection-status', which would require a 5.

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. There are no explicit when/when-not instructions or references to sibling tools like 'connect-database' or 'connection-status' that handle related database connection operations.

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/NakiriYuuzu/Mssql-Mcp'

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