Skip to main content
Glama
PiyapatRag

MS SQL Server MCP Server

by PiyapatRag

MS SQL Server MCP 서버

npm 버전 npm 다운로드 node 라이선스 스폰서

Microsoft SQL Server용 보안 읽기 전용 Model Context Protocol(MCP) 서버로, 성능 모니터링과 잠금 감지 기능이 내장되어 있습니다.

📦 npm: @piyapat/mssql-mcp-server

요구 사항

  • Node.js 22 이상. v2.0.2에서 18에서 상향됨: mssql 12는 tedious 20에 의존하며, 이는 Node 22를 요구합니다.

  • SQL Server 2019(15.x), 2022(16.x), 2025(17.x) — Express를 포함한 모든 에디션. Azure SQL Database는 쿼리/스키마 도구에 대해 작동합니다. mssql_test_connection의 에디션별 참고 사항을 참조하세요.

Related MCP server: mssql-explorer-mcp

npx로 빠른 시작

npx를 사용하여 설치 없이 이 MCP 서버를 직접 실행할 수 있습니다:

npx @piyapat/mssql-mcp-server

설치

옵션 1: npx와 함께 사용 (테스트에 권장)

# Run directly with environment variables
MSSQL_SERVER=localhost \
MSSQL_DATABASE=mydb \
MSSQL_USER=readonly \
MSSQL_PASSWORD=password \
npx @piyapat/mssql-mcp-server

옵션 2: 전역 설치

# Install globally
npm install -g @piyapat/mssql-mcp-server

# Run
mssql-mcp-server

옵션 3: 로컬 설치

# Clone and install
git clone https://github.com/PiyapatRag/mssql-mcp-server.git
cd mssql-mcp-server
npm install
npm run build

# Run
npm start

구성

1단계: .env 파일 생성 (권장)

자격 증명은 .env 파일에 저장됩니다 — MCP 클라이언트의 JSON 구성에 하드코딩하지 않습니다:

cp .env.example .env
# then edit .env with your credentials

서버는 다음 순서로 .env 파일을 찾습니다 (먼저 발견된 것이 우선):

  1. MSSQL_ENV_FILE의 경로 (명시적 재정의)

  2. 현재 작업 디렉터리의 .env

  3. 프로젝트 루트의 .env (package.json 옆)

MCP 클라이언트의 "env" 블록에 이미 설정된 변수는 항상 .env 파일보다 우선하며, .env는 git-ignored입니다.

2단계: Claude Desktop을 서버에 연결

Claude Desktop 구성을 편집합니다:

Windows: %APPDATA%\Claude\claude_desktop_config.json

macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json

프로젝트 루트에 .env가 있으면 JSON에 자격 증명이 전혀 필요하지 않습니다:

{
  "mcpServers": {
    "mssql": {
      "command": "node",
      "args": ["C:\\path\\to\\mssql-mcp-server\\build\\index.js"]
    }
  }
}

.env가 다른 곳에 있으면 해당 경로만 전달합니다:

{
  "mcpServers": {
    "mssql": {
      "command": "node",
      "args": ["C:\\path\\to\\mssql-mcp-server\\build\\index.js"],
      "env": {
        "MSSQL_ENV_FILE": "C:\\secure\\location\\mssql.env"
      }
    }
  }
}

"env" 블록에서 직접 변수를 설정하는 것도 여전히 작동하며 (.env 파일을 재정의) — npx 설정이나 여러 서버를 다른 데이터베이스에 대해 실행할 때 유용합니다.

환경 변수

변수

설명

기본값

필수

MSSQL_SERVER

SQL Server 호스트 이름 또는 IP

localhost

MSSQL_DATABASE

데이터베이스 이름

-

MSSQL_USER

SQL Server 사용자 이름 (MSSQL_DOMAIN이 설정된 경우 도메인 사용자)

-

MSSQL_PASSWORD

비밀번호

-

MSSQL_DOMAIN

Windows/NTLM 도메인. 설정되면 SQL 인증 대신 Windows 인증이 사용됩니다.

-

아니요

MSSQL_PORT

SQL Server 포트

1433

아니요

MSSQL_ENCRYPT

연결 암호화 (true/false). 리터럴 false만 비활성화합니다.

true

아니요

MSSQL_TRUST_CERT

인증서 검증 건너뛰기 (true/false). 옵트인 — 프로덕션에서는 끄지 마세요.

false

아니요

MSSQL_READ_ONLY

true = 읽기 전용 허용 목록 검증. false = 쓰기 모드: INSERT/UPDATE/DELETE/DDL 허용, 서버 수준 위험 문은 계속 차단됩니다.

true

아니요

MSSQL_ALLOWED_PROCEDURES

읽기 전용 모드에서 EXEC가 호출할 수 있는 저장 프로시저의 쉼표로 구분된 허용 목록, 예: dbo.GetReport,dbo.GetCustomerSummary. 비어 있거나 설정되지 않으면 EXEC가 완전히 비활성화됩니다.

-

아니요

MSSQL_ENV_FILE

.env 파일의 명시적 경로

-

아니요

MSSQL_REQUEST_TIMEOUT

쿼리 시간 제한 (ms)

30000

아니요

MSSQL_POOL_MAX

최대 풀 연결 수

10

아니요

MSSQL_AUDIT_LOG

모든 도구 호출을 stderr에 한 줄의 JSON으로 기록 (도구, 모드, 잘린 쿼리, 행 수, 기간, 결과). 비활성화하려면 false로 설정

true

아니요

MSSQL_VERBOSE_ERRORS

드라이버의 전체 오류 텍스트를 클라이언트에 반환. 기본적으로 꺼짐: 오류는 첫 줄로 제한되어 실패한 쿼리가 스키마를 매핑하는 데 사용될 수 없습니다. 전체 세부 정보는 항상 stderr로 전달됩니다.

false

아니요

서버 모드

읽기 전용 모드 (MSSQL_READ_ONLY=true, 기본값)

mssql_query는 다음만 허용합니다:

  • 단일 SELECT / WITH...SELECT

  • DECLARE, INSERT, 또는 CREATE TABLE #...로 시작하는 다중 문 일괄 처리로, 세션 로컬 #temp 테이블 / @table 변수에만 쓰는 경우 — 예: INSERT INTO #t SELECT ... 또는 CREATE TABLE #t (...); INSERT INTO #t ...; SELECT * FROM #t. CREATE INDEX ... ON #t, TRUNCATE/ALTER/DROP TABLE #t도 이러한 일괄 처리 내에서 허용됩니다. 전역 ##temp 테이블은 절대 허용되지 않습니다 (모든 세션에 표시되므로 영구적인 것으로 간주됩니다).

  • 정의가 영구 테이블에 쓰지 않는 허용 목록에 있는 프로시저의 EXEC

그 외의 모든 것은 거부됩니다: 영구 개체에 대한 쓰기/DDL, 동적 SQL, 일괄 처리 내 EXEC (프로시저 허용 목록 우회 방지), DBCC, SELECT/WITH/EXEC 이후의 스택 문.

쓰기 모드 (MSSQL_READ_ONLY=false)

INSERT / UPDATE / DELETE / DDL이 허용되지만, 모드와 관계없이 다음은 항상 차단됩니다:

xp_cmdshell, xp_reg* (읽기 및 쓰기), xp_dirtree, xp_fileexist, sp_OA*, sp_configure, RECONFIGURE, SHUTDOWN, KILL, DROP DATABASE, ALTER DATABASE, RESTORE, BULK INSERT, CREATE ASSEMBLY, CREATE/ALTER/DROP LOGIN/USER/CREDENTIAL/CERTIFICATE, ALTER SERVER, ALTER SERVER ROLE/ALTER ROLE, sp_addrolemember/sp_addsrvrolemember/sp_droprolemember, sp_addlinkedserver, EXECUTE AS, sp_executesql, GRANT/DENY/REVOKE, OPENROWSET/OPENDATASOURCE/OPENQUERY, 그리고 서버 측 파일 판독기 fn_get_audit_file, fn_xe_file_target_read_file, fn_trace_gettable, sp_readerrorlog/xp_readerrorlog.

⚠️ 쓰기 모드는 자체 권한이 동일하게 제한된 SQL 로그인으로만 사용하세요 — 데이터베이스 로그인이 기본 보안 경계로 유지됩니다.

주요 기능

보안 우선

  • 이중 계층 읽기 전용 강제 - 데이터베이스 읽기 전용 로그인(기본)과 애플리케이션 수준 허용 목록(심층 방어). 앱은 SELECT / WITH...SELECT, #temp 테이블 / @table 변수에만 쓰는 DECLARE 일괄 처리, 그리고 정의가 영구 테이블에 절대 쓰지 않는 허용 목록 프로시저의 EXEC를 허용합니다.

  • 따옴표 인식 SQL 스캔 - 주석과 리터럴은 따옴표 상태를 추적하는 단일 왼쪽에서 오른쪽 패스에서 제거되므로 문자열 리터럴에 숨겨진 -- 또는 ;가 분석기를 우회하여 두 번째 문을 밀반입할 수 없습니다.

  • 매개변수화된 쿼리 - 내장된 SQL 주입 보호

  • 기본 SSL/TLS - 암호화 및 인증서 검증은 옵트아웃이지 옵트인이 아닙니다.

  • 스트리밍 결과 페이징 - 행이 스트리밍되고 요청된 페이지를 한 행 지나서 읽기가 취소되므로 큰 SELECT가 서버 메모리를 고갈시킬 수 없습니다.

  • 감사 추적 - 모든 도구 호출이 stderr에 한 줄의 JSON으로 기록됩니다 (MSSQL_AUDIT_LOG).

  • 연결 풀링 - 최적화된 리소스 관리

성능 모니터링

  • 📊 실시간 잠금 감지 - 차단 및 교착 상태 상황 식별

  • 📈 리소스 사용량 추적 - CPU, 메모리 및 쿼리 성능 메트릭

  • 🔍 상위 쿼리 분석 - 리소스 집약적 쿼리 찾기

  • 세션 모니터링 - 활성 및 차단된 세션 추적

데이터베이스 탐색

  • 🗂️ 스키마 인트로스펙션 - 테이블, 열, 키 및 제약 조건

  • 📝 저장 프로시저 분석 - 정의 및 매개변수 보기

  • 🔎 지능형 쿼리 - Claude를 사용한 자연어에서 SQL로

사용 가능한 도구 (19)

핵심

도구

설명

mssql_query

SQL 실행. 기본적으로 읽기 전용 검증; MSSQL_READ_ONLY=false를 통한 쓰기 모드 (위험한 서버 수준 문은 항상 차단). 페이징 + JSON/Markdown 출력.

mssql_test_connection

연결 테스트; 서버/에디션/버전, 데이터베이스, 로그인 및 현재 모드 반환.

mssql_list_databases

상태, 복구 모델, 호환성 수준을 포함한 모든 데이터베이스.

mssql_list_tables

행 수와 크기(MB)가 포함된 테이블, 선택적으로 스키마로 필터링.

mssql_sample_data

테이블에서 행 미리 보기 (기본 10, 최대 100) — SQL 불필요, 주입 안전.

스키마 탐색

도구

설명

mssql_get_schema

테이블별 열, 데이터 형식, PK/FK.

mssql_get_relationships

외래 키 그래프: from/to 테이블+열, 삭제/업데이트 동작.

mssql_get_views

전체 SQL 정의가 포함된 뷰.

mssql_get_stored_procedures

매개변수와 전체 정의가 포함된 저장 프로시저.

mssql_search_definitions

모든 프로시저/뷰/함수/트리거의 소스에서 텍스트 조각을 검색 — 레거시 시스템을 위한 영향 분석.

성능 및 저장소

도구

설명

mssql_analyze_indexes

인덱스 사용 통계(seek/scan/update) + 옵티마이저가 제안하는 누락 인덱스.

mssql_index_fragmentation

인덱스별 단편화와 REBUILD(≥ 30%) / REORGANIZE(5–30%) 권장 사항, 그리고 바로 실행 가능한 ALTER INDEX 문(ONLINE = ON은 지원되는 에디션에서 자동 추가).

mssql_top_queries

cpu, duration, reads, writes, memory(grant 크기) 또는 executions 기준으로 순위가 매겨진 가장 비용이 높은 쿼리 — 합계, 평균, SQL 텍스트.

mssql_performance_health

상태 점검: 상위 대기 통계(무해한 대기는 필터링됨), 메모리 카운터(PLE, 대기 중인 grant, 총계 대 목표), 워크로드 카운터, 규칙 기반 튜닝 권장 사항.

mssql_analyze_storage

크기 기준 최대 테이블 + 데이터베이스 파일 크기.

mssql_monitor_usage

세션, CPU, 버퍼 캐시, CPU 기준 상위 쿼리.

잠금, 차단 및 교착 상태

SQL Server 2019(15.x), 2022(16.x), 2025(17.x) — Express를 포함한 모든 에디션에서 지원됩니다. 출력에는 감지된 서버 버전/에디션이 포함되며, 이전 버전에서 실행 중일 때 경고합니다(최선 노력). VIEW SERVER STATE 권한이 필요합니다.

버전 및 에디션 호환성:

Express

Standard

Enterprise / Developer / Eval

Azure SQL MI

Azure SQL DB

쿼리 / 스키마 / 저장소 도구

mssql_monitor_locks / mssql_find_blocking

mssql_get_deadlocks (system_health XE)

❌ (도구가 대안을 설명함)

mssql_list_databases / mssql_monitor_usage

⚠️ 제한된 범위

위 행/열은 SQL Server 2019, 2022, 2025에 적용됩니다. 이전 버전 (2016/2017)은 대부분 작동하지만 도구 출력에서 최선 노력으로 보고됩니다. mssql_test_connection은 감지된 에디션 클래스와 해당 엔진 제한 사항(예: Express: 데이터베이스당 10GB, ~1.4GB 버퍼 풀, 4코어)을 보고합니다.

도구

설명

mssql_monitor_locks

세션별 현재 잠금 및 대기의 원시 보기.

mssql_find_blocking

차단 체인(피해자 ← 차단자), 열린 트랜잭션을 보유한 유휴 세션을 포함한 선두 차단자 식별, 양쪽의 SQL 텍스트 포함.

mssql_get_deadlocks

기본 제공 system_health 확장 이벤트 세션의 최근 교착 상태 이벤트: 피해자, 관련 쿼리, 전체 교착 상태 그래프 XML. source: "ring_buffer"(빠름, 최근) 또는 "file"(더 이전).

Claude 예시:

"Show me the top 10 customers by order count"
"Which tables are the largest, and which indexes are unused?"
"Which sessions are blocked right now, and who is the root blocker?"
"Were there any deadlocks last night, and which query caused them?"
"Find every stored procedure that references the CustomerOrders table"

보안 설정

읽기 전용은 두 계층으로 강제됩니다. 데이터베이스 로그인이 기본 방어 수단입니다 — 서버에 도달한 쓰기 문장조차 실행할 수 없습니다. 애플리케이션 수준 허용 목록(src/index.tsclassifyQuery)은 심층 방어입니다: 읽기 전용 진입점만 허용하고 그 외 모든 것(쓰기, DDL, 동적 SQL, 스택 쿼리)을 거부합니다. 단어를 차단하는 대신 선행 키워드를 허용 목록에 넣기 때문에 Create, Update, CreatedDate 등으로 이름이 지정된 열이나 별칭은 차단되지 않습니다.

읽기 전용 SQL 사용자 생성(권장)

바로 실행 가능한 스크립트가 scripts/create-readonly-login.sql에 제공됩니다 — 자리 표시자를 편집하고 sysadmin으로 실행하세요. 아래의 최소 권한 설정을 적용합니다:

-- 1. Create login
CREATE LOGIN mcp_readonly WITH PASSWORD = 'SecurePassword123!';

-- 2. Switch to your database
USE YourDatabase;

-- 3. Create user
CREATE USER mcp_readonly FOR LOGIN mcp_readonly;

-- 4. Grant read permissions
ALTER ROLE db_datareader ADD MEMBER mcp_readonly;

-- 4b. Explicitly DENY writes (defense-in-depth)
ALTER ROLE db_denydatawriter ADD MEMBER mcp_readonly;

-- 5. Grant monitoring permissions
GRANT VIEW SERVER STATE TO mcp_readonly;
GRANT VIEW DATABASE STATE TO mcp_readonly;
GRANT VIEW DEFINITION TO mcp_readonly;

-- 6. Verify permissions
SELECT
    dp.name AS DatabaseUser,
    dp.type_desc,
    r.name AS RoleName
FROM sys.database_principals dp
LEFT JOIN sys.database_role_members drm ON dp.principal_id = drm.member_principal_id
LEFT JOIN sys.database_principals r ON drm.role_principal_id = r.principal_id
WHERE dp.name = 'mcp_readonly';

개발

빌드

npm run build

감시 모드

npm run dev

로컬 테스트

# Set environment variables
export MSSQL_SERVER=localhost
export MSSQL_DATABASE=testdb
export MSSQL_USER=sa
export MSSQL_PASSWORD=password

# Run
npm start

문제 해결

npx 사용 시 "command not found" 오류

npx로 실행할 때 오류가 발생하면:

  1. Node.js 22+가 설치되어 있는지 확인하세요:

node --version
  1. npm 캐시를 지우세요:

npm cache clean --force
  1. 전체 패키지 이름으로 시도하세요:

npx --package=@piyapat/mssql-mcp-server mssql-mcp-server

연결 오류

오류: 사용자에 대한 로그인 실패

-- Check authentication mode (must be Mixed Mode)
USE master;
GO
EXEC xp_instance_regread
  N'HKEY_LOCAL_MACHINE',
  N'Software\Microsoft\MSSQLServer\MSSQLServer',
  N'LoginMode';
GO
-- Should return 2 for Mixed Mode

오류: 서버에 연결할 수 없음

  • SQL Server Browser 서비스가 실행 중인지 확인하세요

  • 방화벽이 포트 1433을 허용하는지 확인하세요

  • SQL Server 구성 관리자에서 TCP/IP 프로토콜이 활성화되어 있는지 확인하세요

권한 오류

-- Grant additional permissions if needed
USE YourDatabase;
GRANT EXECUTE TO mcp_readonly;  -- If you need to call stored procedures
GRANT SHOWPLAN TO mcp_readonly; -- For execution plans

취약점 신고

보안 버그에 대해 공개 이슈를 열지 마세요. GitHub 비공개 취약점 신고를 사용하거나 npm 패키지 페이지의 관리자 주소를 사용하세요. 범위, 대응 목표, 그리고 안전한 항구 조건은 SECURITY.md에 있습니다.

scripts/security-validation.mjs의 가드 배터리는 실제 컴파일된 분석기를 ~100개의 공격 사례에 대해 실행하며 CI에서 실행됩니다 — npm run test:security로 로컬에서 재현할 수 있습니다.

보안 감사 인사

🙏 Kietgboiz17 님께 감사드립니다 (kietgboiz17@gmail.com) — 보안 검토, 취약점 보고, 그리고 이 프로젝트를 강화한 레드팀 활동(2.0.2에서 수정된 읽기 전용 가드 우회 및 2.0.3의 추가 가드 강화 포함)에 감사드립니다. 자세한 내용은 CHANGELOG.mdSECURITY_REVIEW.md를 참조하세요.

모범 사례

  1. 프로덕션에서는 항상 읽기 전용 계정을 사용하세요

  2. 암호화를 유지하세요 (MSSQL_ENCRYPT=true, MSSQL_TRUST_CERT=false) — 둘 다 기본값입니다

  3. 정기적으로 모니터링하세요 - 정기적인 모니터링 점검을 설정하세요

  4. 결과 집합을 제한하세요 - maxRows를 사용하세요. 행은 스트리밍되므로 페이지가 읽히는 전부입니다

  5. 인덱스 최적화 - 느린 쿼리를 모니터링하고 인덱스를 추가하세요

  6. 정기적인 유지 관리 - 통계를 최신 상태로 유지하세요

  7. 액세스 감사 - MSSQL_AUDIT_LOG를 켜고 서버의 stderr 로그를 보관하세요

기여

기여를 환영합니다 — 개발 설정, 풀 리퀘스트 지침, 릴리스 프로세스는 CONTRIBUTING.md를 참조하세요. 버전 기록은 CHANGELOG.md에서 추적됩니다.

라이선스

MIT 라이선스 - 필요에 따라 자유롭게 사용하고 수정하세요.

사용된 기술

지원

문제가 발생한 경우:

  1. 문제 해결 섹션을 확인하세요

  2. SQL Server 오류 로그를 검토하세요

  3. Claude Desktop 로그를 확인하세요

  4. 데이터베이스 권한을 확인하세요


Claude Desktop용으로 제작보안 우선성능 중심

Available Tools

17 tools
mssql_analyze_indexesA
Read-only

Analyze index usage (seeks/scans/lookups/updates per index) and list potentially missing indexes suggested by the query optimizer. Optionally filter usage stats by table name.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableNameNoOptional: only show index usage for this table.
response_formatNoResponse format (default: markdown)markdown

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the tool is read-only. The description adds valuable behavioral context (e.g., it returns seeks/scans/lookups/updates and missing index suggestions) beyond the annotations, without contradiction.

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 two sentences, front-loading the core purpose and listing the key outputs (seeks/scans/lookups/updates and missing indexes). Every word adds value, with no redundancy.

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

Completeness4/5

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

Tool has 2 parameters, no output schema. The description explains the output (index usage metrics and missing index suggestions) but does not detail the response format or how missing indexes are presented. Still, it covers the main functionality adequately for its complexity.

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

Parameters3/5

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

Schema coverage is 100%, so baseline is 3. The description adds minimal extra meaning: it rephrases the tableName parameter as 'Optionally filter usage stats by table name' and response_format is self-explanatory. No substantive enrichment.

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 analyzes index usage and lists missing indexes, with optional table filtering. It is distinct from siblings like mssql_index_fragmentation (focuses on fragmentation) and mssql_get_schema, but does not explicitly differentiate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies it should be used for analyzing index performance and finding optimization opportunities, but provides no explicit 'when to use' or 'when not to use' guidance, nor does it mention alternatives among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_analyze_storageA
Read-only

Analyze storage: largest tables by size (row count, total/used MB) and database file sizes. Useful for capacity planning and finding space hogs.

ParametersJSON Schema
NameRequiredDescriptionDefault
topTablesNoNumber of largest tables to return (default: 20)
response_formatNoResponse format (default: markdown)markdown

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=true and destructiveHint=false, so the description does not contradict them. It adds value by detailing what is analyzed (largest tables, file sizes) beyond the annotations. No additional behavioral traits are disclosed, but the description is consistent and provides useful context.

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, concise sentence that effectively communicates the tool's purpose and output. It is front-loaded with the key action and resource, with no wasted words.

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

Completeness5/5

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

Despite no output schema, the description explicitly lists the output elements (row count, total/used MB for tables, database file sizes). It covers the needed context for an analysis tool with simple parameters. Parameter coverage is complete, and the description is sufficient for understanding what the tool returns.

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

Parameters3/5

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

Schema coverage is 100%, meaning both parameters (topTables, response_format) have descriptions in the input schema. The description does not add significant meaning beyond what the schema provides; it only implies that topTables refers to largest tables by size. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it analyzes storage, specifically largest tables by size (row count, total/used MB) and database file sizes. This is a specific verb+resource combination that distinguishes it from siblings like mssql_analyze_indexes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'useful for capacity planning and finding space hogs', providing a clear context for use. However, it does not explicitly state when not to use it or suggest alternatives, which would improve guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_find_blockingA
Read-only

Find current blocking chains: which sessions are blocked, by whom, on what resource, and for how long. Identifies lead blockers (including idle sessions holding open transactions) with their SQL text. Supported: SQL Server 2019 (15.x), 2022 (16.x), 2025 (17.x) — all editions including Express. Requires VIEW SERVER STATE.

ParametersJSON Schema
NameRequiredDescriptionDefault
response_formatNoResponse format (default: markdown)markdown

TDQS

A4.2/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=true and destructiveHint=false. The description adds that it requires VIEW SERVER STATE permission, providing important behavioral context. It does not contradict annotations.

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 concise (two sentences), front-loads the core purpose, and includes version support and permission requirement without extraneous text.

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

Completeness4/5

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

The description adequately covers what the tool does and what it returns (lead blockers with SQL text). No output schema exists, so the description provides sufficient context for a focused diagnostic tool.

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

Parameters3/5

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

The input schema has 100% coverage with a single parameter (response_format) and enum. The description does not add further meaning beyond what the schema provides, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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: 'Find current blocking chains', specifying what it identifies (sessions, blocked, by whom, resource, duration) and lead blockers with SQL text. This is specific and distinct from sibling tools like mssql_monitor_locks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions version support and required permission (VIEW SERVER STATE), providing some usage context. However, it does not explicitly state when to use this tool over alternatives like mssql_monitor_locks or mssql_get_deadlocks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_get_deadlocksA
Read-only

Retrieve recent deadlock events from the built-in system_health Extended Events session, including the full deadlock graph XML, victim sessions, and the queries involved. Source 'ring_buffer' (default, fast, recent events only) or 'file' (reads system_health .xel files, further back but slower). Supported: SQL Server 2019 (15.x), 2022 (16.x), 2025 (17.x) — all editions including Express. Requires VIEW SERVER STATE.

ParametersJSON Schema
NameRequiredDescriptionDefault
sourceNo'ring_buffer' = in-memory recent events (fast). 'file' = system_health event files (older history, slower).ring_buffer
maxEventsNoMaximum number of deadlock events to return (default: 5, max: 25)
response_formatNoResponse format (default: markdown)markdown

TDQS

A4.7/5.0
Behavior5/5

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

Annotations indicate read-only and non-destructive. The description expands with version support, permission requirement (VIEW SERVER STATE), and source behavior. Adds significant value beyond annotations.

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?

Concise, front-loaded with main purpose, then efficiently covers sources, version support, and permissions. Every sentence is informative with no redundancy.

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

Completeness5/5

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

Given three optional parameters and no output schema, the description covers return content, version support, permission, and source behavior. Complete for a deadlock retrieval tool.

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?

Schema description coverage is 100% and parameter descriptions are already detailed. The description adds context about source trade-offs (fast vs far back) not fully captured in schema enum descriptions. Overall adds value but not critical.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (retrieve), the resource (deadlock events from system_health session), and specifies included content (deadlock graph XML, victim sessions, queries). It distinguishes from sibling tools, none of which are about deadlocks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides guidance on choosing between 'ring_buffer' and 'file' sources based on recency and speed. Also mentions supported versions and required permission. Lacks explicit when-not-to-use or alternatives, but no direct sibling alternatives exist.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_get_relationshipsA
Read-onlyIdempotent

Get foreign key relationships between tables: constraint name, from/to table and column, and delete/update actions. Optionally filter by table name (matches either side).

ParametersJSON Schema
NameRequiredDescriptionDefault
tableNameNoOptional: only show relationships involving this table.
response_formatNoResponse format (default: markdown)markdown

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, so the description only adds minor context (filtering behavior). No contradictions, but no additional behavioral traits like performance impact.

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 two sentences, front-loading the core purpose and then the optional filter. No superfluous words, every sentence adds value.

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

Completeness4/5

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

Given no output schema, the description adequately explains the return fields. It implies the output includes all relationships when no filter is applied. Lacks explicit statement about default behavior (all relationships) but is sufficient for the tool's simplicity.

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?

Both parameters are fully described in the schema (100% coverage). The description adds value by clarifying that tableName matches on either side of the relationship, which is not evident from the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves foreign key relationships and lists the specific fields returned (constraint name, tables/columns, actions). It distinguishes from siblings like mssql_get_schema or mssql_list_tables by focusing on foreign key constraints.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions optional filtering by table name, but does not provide guidance on when to use this tool versus alternatives like mssql_get_schema. No exclusions or prerequisites are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_get_schemaA
Read-onlyIdempotent

Get database schema information including tables, columns, data types, primary keys, and foreign keys. Optionally filter by table name.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableNameNoOptional: specific table name to get schema for. If not provided, returns all tables.
response_formatNoResponse format: 'json' for machine-readable, 'markdown' for human-readable (default: markdown)markdown

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the agent knows this is a safe read-only operation. The description adds what data is returned but does not disclose additional behavioral traits (e.g., performance impact, system table queries). No contradiction with annotations.

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, well-structured sentence that front-loads the core purpose and then adds optional detail. Every word adds value, with no fluff or redundancy.

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

Completeness4/5

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

The description sufficiently covers the tool's functionality for a simple read-only schema retrieval tool. It mentions the key return components and optional filtering. However, it could be slightly more complete by noting that the output format can be specified (already in param schema) and that all tables are returned if no filter is given (already in param schema).

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 100% description coverage for both parameters (tableName and response_format). The description adds context about the returned data (tables, columns, types, keys) that is not in the schema, enhancing understanding beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves database schema information including tables, columns, data types, primary keys, and foreign keys, with optional table name filtering. This distinguishes it from sibling tools like mssql_get_relationships, mssql_get_views, etc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives. While the purpose is clear, it lacks guidance like 'For relationships only, use mssql_get_relationships' or 'Use this for a full schema overview.' Usage is implied but not spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_get_stored_proceduresA
Read-onlyIdempotent

List stored procedures in the database with their definitions and parameters. Optionally filter by procedure name.

ParametersJSON Schema
NameRequiredDescriptionDefault
procedureNameNoOptional: specific procedure name to get details for. If not provided, returns all procedures.
response_formatNoResponse format: 'json' for machine-readable, 'markdown' for human-readable (default: markdown)markdown

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare this as read-only and idempotent. The description adds that it returns definitions and parameters, which provides extra context. No behavioral traits beyond annotations are disclosed, but no contradictions either.

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 two sentences: the first conveys the main purpose, the second adds a key option. Every sentence is necessary, no wasted words.

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?

The tool has no output schema, so the description should ideally hint at the return structure. It mentions 'definitions and parameters' but lacks specifics. For a simple listing tool with safe annotations, this is somewhat adequate but could benefit from more detail about what the output contains.

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

Parameters3/5

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

Schema coverage is 100%, so both parameters are fully described. The description adds a brief explanation for the optional filter and clarifies the response_format enum values, but does not add significant meaning beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists stored procedures with definitions and parameters, using a specific verb and resource. It distinguishes from siblings like mssql_get_views or mssql_get_schema by focusing on stored procedures.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions optional filtering by procedure name, giving a hint about usage. However, it does not explicitly state when to use this tool versus alternatives (e.g., mssql_get_schema or mssql_query), nor does it provide any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_get_viewsA
Read-onlyIdempotent

List views in the database with their full SQL definitions. Optionally filter by view name to get a single view's definition.

ParametersJSON Schema
NameRequiredDescriptionDefault
viewNameNoOptional: specific view name to get the definition for.
response_formatNoResponse format (default: markdown)markdown

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds that it returns full SQL definitions but no further behavioral context like permissions or performance.

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?

Two sentences, concise and front-loaded. Every sentence adds value with no extraneous information.

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

Completeness4/5

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

For a simple read-only tool with complete annotations and schema, the description is adequate. It explains the return content (full SQL definitions). Minor: no mention of result format beyond response_format parameter.

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

Parameters3/5

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

Schema coverage is 100% with descriptions for both parameters. The tool description repeats the filtering functionality but adds no new meaning beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it lists views with their full SQL definitions and optionally filters by view name. It distinguishes from sibling tools that focus on relationships, indexes, etc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide explicit when-to-use or alternatives, but the purpose is specific enough to infer appropriate use cases. No guidance on when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_index_fragmentationA
Read-only

Analyze index fragmentation and recommend maintenance: REBUILD (fragmentation ≥ 30%), REORGANIZE (5–30%), or OK (< 5%). Generates ready-to-run ALTER INDEX statements (ONLINE=ON suggested automatically on editions that support it). Small indexes below minPageCount are excluded since fragmentation there is harmless.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableNameNoOptional: analyze only this table.
minPageCountNoIgnore indexes smaller than this many pages (default: 100 ≈ 800 KB).
response_formatNoResponse format (default: markdown)markdown

TDQS

A4.7/5.0
Behavior5/5

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

The description goes beyond annotations (readOnlyHint=true, destructiveHint=false) by explaining that it generates ready-to-run ALTER INDEX statements (not executing them), suggests ONLINE=ON on supported editions, and excludes small indexes. No contradictions with annotations.

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 two sentences long, clearly structured. The first sentence covers core functionality and thresholds; the second provides details on output and edge cases. No unnecessary words.

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

Completeness5/5

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

The description fully covers what the tool does, how to use it (input parameters), what it produces (ALTER INDEX statements), and important edge cases (small indexes). Given the simplicity (3 optional params, no output schema, read-only), it is complete.

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?

Schema coverage is 100% with descriptions for each parameter. The description adds value by explaining the purpose of minPageCount (harmless fragmentation below threshold) and the format options. This enriches the meaning beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it analyzes index fragmentation and recommends maintenance actions with specific thresholds (REBUILD ≥30%, REORGANIZE 5-30%, OK <5%). It also mentions generating ALTER INDEX statements and excluding small indexes. This distinguishes it from sibling tools like mssql_analyze_indexes or mssql_performance_health.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use the tool (to check fragmentation and get maintenance scripts) and includes thresholds. It implicitly excludes small indexes via minPageCount, but does not explicitly state when not to use it or compare to alternatives like mssql_analyze_indexes. However, the guidance is sufficient for most cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_list_databasesA
Read-onlyIdempotent

List all databases on the SQL Server instance with state, recovery model, compatibility level, and creation date.

ParametersJSON Schema
NameRequiredDescriptionDefault
response_formatNoResponse format (default: markdown)markdown

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already indicate readOnly and idempotent. Description adds specifics about returned data (state, recovery model, compatibility level, creation date), beyond annotation details.

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?

Single sentence, no redundant words, efficiently conveys tool action and output contents.

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

Completeness4/5

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

For a simple list operation, description covers key output attributes. No output schema, but return values are implied. Slightly lacking in specifying that it returns a list.

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

Parameters3/5

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

Only one parameter (response_format) with 100% schema description coverage. Tool description adds no additional parameter meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'List all databases' with specific attributes (state, recovery model, etc.), distinguishing it from sibling tools like mssql_list_tables or mssql_get_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?

No explicit guidance on when to use this tool versus alternatives like mssql_get_schema or mssql_analyze_storage, and no exclusion criteria provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_list_tablesA
Read-onlyIdempotent

List tables in the current database with schema, row count, and size in MB. Optionally filter by schema name.

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaNameNoOptional: filter tables by schema (e.g. 'dbo'). Default: all schemas.
response_formatNoResponse format (default: markdown)markdown

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. Description adds that it returns schema, row count, size in MB, providing useful behavioral context beyond annotations.

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?

Description is a single sentence, front-loaded with core purpose, no wasted words.

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

Completeness5/5

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

For a simple read-only listing tool with clear annotations and full schema coverage, the description is sufficiently complete. It explains output fields and optional filter, no gaps.

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

Parameters3/5

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

Schema description coverage is 100%, so baseline is 3. Description only restates that schemaName filter is optional, adding no new meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it lists tables with schema, row count, and size in MB, and allows optional filtering. This distinguishes it from sibling tools like mssql_get_views or mssql_get_schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description mentions optional schema filter but does not explicitly state when to use this tool versus alternatives. However, the purpose is clear enough for selection among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_monitor_locksA
Read-only

Monitor database locks, blocking sessions, and potential deadlocks. Shows lock types, resources, and wait times.

ParametersJSON Schema
NameRequiredDescriptionDefault
response_formatNoResponse format: 'json' for machine-readable, 'markdown' for human-readable (default: markdown)markdown

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=true, so the tool is safe. The description adds context about outputs (lock types, resources, wait times) beyond the annotation, enhancing transparency.

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?

Two concise sentences with no fluff. Information is front-loaded and every sentence adds value.

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

Completeness4/5

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

For a low-complexity monitoring tool with no output schema, the description adequately covers what it monitors and shows. It could mention that it returns a snapshot, but overall complete.

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

Parameters3/5

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

Schema coverage is 100% for the single parameter response_format, with enum and default descriptions. The tool description does not add further parameter meaning, so baseline 3 is appropriate.

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 monitors database locks, blocking sessions, and deadlocks, with specific outputs. It distinguishes from siblings like mssql_find_blocking and mssql_get_deadlocks, but could be more explicit about its broader scope.

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. It does not mention scenarios, prerequisites, or when to prefer mssql_find_blocking or mssql_get_deadlocks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_monitor_usageB
Read-only

Get database resource usage statistics including CPU, memory, active sessions, and top resource-consuming queries.

ParametersJSON Schema
NameRequiredDescriptionDefault
topQueriesNoNumber of top CPU-consuming queries to return (default: 10)
response_formatNoResponse format: 'json' for machine-readable, 'markdown' for human-readable (default: markdown)markdown

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description's role is light. It adds context about the types of statistics returned (CPU, memory, sessions, top queries), which is useful. No contradictions.

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?

Single sentence, front-loaded with verb, no filler. Every word is necessary and informative.

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

Completeness4/5

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

Given the simplicity of the tool (2 optional params, no output schema), the description covers the key data returned. It could optionally mention the time window or aggregation level, but overall it provides sufficient context for an agent to invoke it correctly.

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

Parameters3/5

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

Schema coverage is 100% with descriptions for both parameters. The description adds no additional semantic detail beyond what the schema provides, so baseline 3 is appropriate.

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 retrieves database resource usage statistics including CPU, memory, sessions, and top queries. It is specific and actionable, but does not explicitly differentiate it from sibling tools like mssql_top_queries or mssql_performance_health.

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?

There is no guidance on when to use this tool versus alternatives. For example, it doesn't explain that for detailed query-level analysis one should use mssql_top_queries. Agents receive no contextual hints for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_performance_healthA
Read-only

Overall performance health check: top wait statistics (with benign waits filtered out), memory counters (Page Life Expectancy, memory grants pending, total vs target memory), workload counters (batch requests, compilations), and rule-based optimization recommendations (e.g. high CXPACKET → review MAXDOP, PAGEIOLATCH → check I/O and indexes, LCK_M → run mssql_find_blocking).

ParametersJSON Schema
NameRequiredDescriptionDefault
response_formatNoResponse format (default: markdown)markdown

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, destructiveHint=false. Description expands on what is read (wait stats, memory, workload) and adds behavioral details like filtering benign waits and offering recommendations. No contradiction.

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?

Single sentence includes all necessary details without excessive verbosity. Well-structured and front-loaded with purpose.

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

Completeness4/5

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

Given no output schema, description adequately covers return categories (wait stats, memory, workload, recommendations). References sibling tools for further action. Complete for a summary health check.

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

Parameters3/5

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

Single parameter (response_format) with 100% schema coverage; description does not add additional semantics beyond the schema. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly identifies it as an overall performance health check, listing specific areas (wait stats, memory, workload, recommendations). It distinguishes itself from siblings by mentioning rule-based recommendations that reference other tools like mssql_find_blocking.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage for an overall health check. Provides context by referencing sibling tools for specific scenarios (e.g., LCK_M → mssql_find_blocking). Does not explicitly state when not to use or provide exclusions, but context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_queryA
Read-onlyIdempotent

Execute a read-only SQL query against the MS SQL Server database. Accepts: a single SELECT / WITH...SELECT; a multi-statement batch led by DECLARE, INSERT, or CREATE TABLE # that writes ONLY to session-local #temp tables or @table variables (global ##temp is never allowed); or EXEC of a whitelisted stored procedure whose definition does not write to a persistent table. Writes to real tables, DDL on persistent objects, dynamic SQL, EXEC inside batches, and DBCC are blocked (server runs with MSSQL_READ_ONLY=true). Returns results as JSON or Markdown.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe SQL to execute. Must be read-only: a SELECT/WITH query, a DECLARE batch using only #temp/@table targets, or EXEC of an allowed read-only stored procedure.
offsetNoRow offset for pagination (default: 0)
maxRowsNoMaximum number of rows to return per page (default: 100, max: 1000)
response_formatNoResponse format: 'json' for machine-readable, 'markdown' for human-readable (default: json)json

TDQS

A4.7/5.0
Behavior5/5

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

The description adds substantial behavioral context beyond annotations (readOnlyHint, idempotentHint, destructiveHint), explaining allowed query patterns, blocked operations, server configuration (MSSQL_READ_ONLY=true), and response formats. No contradiction with annotations.

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 dense paragraph that front-loads the main purpose. It is informative but could be more concise by splitting into bullet points or shortening examples. Nonetheless, every sentence adds value.

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

Completeness4/5

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

Given the complexity of SQL execution and no output schema, the description covers allowed queries, blocked operations, and response formats. It lacks details on error handling or pagination behavior, which would improve completeness.

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?

With 100% schema coverage, the baseline is 3. The description reinforces the query parameter's allowed forms, adding detail beyond the schema's brief description. However, it does not add new semantics for offset, maxRows, or response_format beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes a read-only SQL query against MS SQL Server, and distinguishes it from sibling tools by specifying exact allowed query types (SELECT, WITH...SELECT, temp-table batches, whitelisted procs) and blocked operations (writes, DDL, dynamic SQL).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly details when to use (read-only queries) and when not (writes, DDL, dynamic SQL, DBCC), providing clear constraints. It implicitly guides the agent to select this tool for read queries versus sibling tools for schema or analysis.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_sample_dataA
Read-onlyIdempotent

Retrieve sample rows from a table (default 10, max 100). Safe way to preview data without writing SQL. Accepts 'table' or 'schema.table'.

ParametersJSON Schema
NameRequiredDescriptionDefault
rowsNoNumber of rows to sample (default: 10, max: 100)
tableNameYesTable name, optionally schema-qualified (e.g. 'Orders' or 'dbo.Orders').
response_formatNoResponse format (default: markdown)markdown

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds that it's a safe preview, reinforces non-destructive behavior, and provides row limits – all consistent with annotations.

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?

Two concise sentences with no extraneous text. Key information (purpose, defaults, safety) is front-loaded for quick parsing.

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

Completeness4/5

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

Covers purpose, parameters, and safety adequately. No output schema, but description doesn't need to detail return format beyond what schema provides. Minor gap: doesn't specify sampling method (e.g., TOP vs random).

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?

All parameters have schema descriptions (100% coverage). The description adds valuable context: default row count, max 100, and format for table names, complementing the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states retrieving sample rows from a table, specifying defaults and limits. It distinguishes from sibling tools like mssql_query (requires SQL) and mssql_get_schema (schema metadata).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly positions the tool as a safe, low-friction way to preview data without writing SQL. While it doesn't explicitly list alternatives, the context of sibling tools implies when not to use it (e.g., for complex queries).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_top_queriesA
Read-only

Find the most expensive queries from the plan cache, ranked by a chosen metric: cpu, duration, reads (logical I/O), writes, memory (grant size), or executions. Returns per-query totals and averages with the SQL text — the starting point for performance tuning.

ParametersJSON Schema
NameRequiredDescriptionDefault
topNoNumber of queries to return (default: 10, max: 50)
metricNoRanking metric (default: cpu)cpu
response_formatNoResponse format (default: markdown)markdown

TDQS

A3.7/5.0
Behavior3/5

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

The description confirms read-only behavior (finding expensive queries) which aligns with annotations (readOnlyHint=true). No additional behavioral traits beyond annotations are disclosed, but no contradictions exist. The description adds minimal value beyond what annotations provide.

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 two sentences long, direct, and contains no redundant information. Every word serves a purpose, making it highly efficient for an AI agent to parse quickly.

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

Completeness4/5

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

Given the tool has three well-described parameters, no output schema, and clear annotations, the description adequately explains purpose, metrics, and return content. It could provide more detail on output structure, but for a starting-point tool, it is sufficiently complete.

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?

Schema coverage is 100% with detailed parameter descriptions. The description adds context by explaining the metrics (e.g., 'reads (logical I/O)') and that returns include per-query totals and averages, enhancing understanding beyond the raw schema. This justifies a score above the baseline of 3.

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 finds the most expensive queries from the plan cache, ranked by a chosen metric, and returns per-query totals and averages with SQL text. It distinguishes itself from siblings by focusing on plan cache and performance tuning, though it does not explicitly contrast with similar tools like mssql_performance_health.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description describes the tool as 'the starting point for performance tuning', which implies when to use it. However, it lacks explicit guidance on when not to use it or clear differentiation from sibling tools. The context is implied but not directly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.9/5.0
Disambiguation5/5

Each tool targets a clearly distinct area: schema inspection, data preview, query execution, performance analysis, and monitoring. Even related tools like find_blocking, monitor_locks, and get_deadlocks have specific, non-overlapping purposes.

Naming Consistency3/5

Most tools follow a verb_noun pattern (get_, analyze_, monitor_, list_), but several deviate: mssql_index_fragmentation, mssql_top_queries, mssql_sample_data, mssql_query, and mssql_performance_health lack a clear verb prefix, breaking consistency.

Tool Count5/5

17 tools is well-scoped for a SQL Server database server covering schema, data, queries, performance, and monitoring. Each tool adds distinct value without being overwhelming.

Completeness4/5

The tool set covers schema browsing, data sampling, ad-hoc queries, performance tuning, and monitoring comprehensively. Minor gaps exist (e.g., missing query plan details, table statistics), but core workflows are well-supported.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Read-only SQL Server MCP server enabling safe database queries, table listing, and schema inspection with built-in security protections.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A read-only MCP server for exploring on-premises, multi-instance Microsoft SQL Server estates from AI clients, with read-only enforcement and Windows authentication support.
    Apache 2.0
  • A
    license
    A
    quality
    C
    maintenance
    A read-only MCP server for Microsoft SQL Server that allows running SELECT queries and analyzing query performance with statistics.
    4
    907
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    A read-only MCP server for browsing and querying SQL Server databases, providing tools to list schemas, tables, describe columns, and execute safe SELECT queries with validated parameters.
    15

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/PiyapatRag/mssql-mcp-server'

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