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('已斷開資料庫連接') } }

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