Skip to main content
Glama
NakiriYuuzu

MSSQL MCP Server

by NakiriYuuzu

connection-status

Verify the current database connection status on MSSQL MCP Server to ensure stable and reliable interactions with Microsoft SQL Server databases.

Instructions

檢查目前的資料庫連接狀態

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that implements the logic for the 'connection-status' tool: checks connection status, current database, tests the connection, and returns a text response with the status.
    async () => { try { const isConnected = mssqlManager.isConnected() const currentDb = mssqlManager.getCurrentDatabase() if (!isConnected) { return { content: [ { type: 'text' as const, text: '狀態: 未連接到資料庫伺服器' } ] } } const testResult = await mssqlManager.testConnection() const status = testResult ? '已連接且運作正常' : '連接異常' return { content: [ { type: 'text' as const, text: `狀態: ${status}${currentDb ? `\n目前資料庫: ${currentDb}` : '\n未選擇資料庫'}` } ] } } catch (error) { return { content: [ { type: 'text' as const, text: `檢查連接狀態失敗: ${error instanceof Error ? error.message : String(error)}` } ] } } }
  • src/index.ts:432-475 (registration)
    Registers the 'connection-status' tool with the MCP server, providing title, description, and the inline handler function.
    'connection-status', { title: '連接狀態', description: '檢查目前的資料庫連接狀態' }, async () => { try { const isConnected = mssqlManager.isConnected() const currentDb = mssqlManager.getCurrentDatabase() if (!isConnected) { return { content: [ { type: 'text' as const, text: '狀態: 未連接到資料庫伺服器' } ] } } const testResult = await mssqlManager.testConnection() const status = testResult ? '已連接且運作正常' : '連接異常' return { content: [ { type: 'text' as const, text: `狀態: ${status}${currentDb ? `\n目前資料庫: ${currentDb}` : '\n未選擇資料庫'}` } ] } } catch (error) { return { content: [ { type: 'text' as const, text: `檢查連接狀態失敗: ${error instanceof Error ? error.message : String(error)}` } ] } } } )

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