MCP server for Microsoft SQL Server database operations with schema inspection and query execution
This MCP server has 3 tools with critical definition quality gaps. Tool naming is reasonable (GetSchema, Query, HealthCheck start with verbs), but descriptions are minimal and lack LLM-optimization guidance. Most critically, input schemas are missing proper parameter descriptions, the Query tool accepts a 'query' parameter with a type but no validation constraints, format guidance, or safety warnings. No output schemas are documented. Error handling returns unstructured JSON error objects rather than actionable recovery guidance. The tools are directly callable via C# attributes ([McpServerTool]), but parameter definitions lack the depth required for reliable agent operation. No parameter validation, rate limiting, or permission gating is visible.
Get a list of all tables with their respective schema, columns and types (SQL SERVER).
Tests if the Microsoft SQL Server Database connection is good and alive.
Execute a query into the Microsoft SQL Server database and return the result as a JSON
Input schemas lack parameter descriptions and constraints. Query tool accepts 'query' parameter with only type 'string' but no guidance on SQL dialect, size limits, allowed operations, or injection risk. LLMs cannot infer safety boundaries without explicit constraints.
No output schemas documented. GetSchema and Query return JSON but field names, types, and structure are inferred from code. Agents cannot plan downstream operations without knowing response shape. Example: GetSchema returns nested dict with 'schema', 'name', 'type' fields, but this is not declared in tool definition.
Query tool description lacks safety warnings. It says 'Execute a query' but does not warn that arbitrary SQL can modify data, drop tables, or cause data loss. Missing: 'WARNING: Accepts arbitrary SQL, validate queries carefully. Cannot be rolled back if agent makes mistakes.'
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-21 | F | 37 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 38 | - | v1 |
Error handling returns bare error objects (e.g. {"error": "ex.Message"}) with no recovery guidance. An LLM receiving 'Connection timeout' has no idea whether to retry, check configuration, or call a different tool. Missing: structured error responses with retryable/user-fixable/fatal classification.
SQL injection risk not mitigated at tool definition level. Query tool accepts unsanitized SQL string. While SqlCommand does use parameterized queries internally, the tool does not document this or provide parameter injection points. An LLM might pass malicious SQL expecting it to fail safely.
Connection string loaded from unencrypted file (env.database). If this file is committed to repo or world-readable, database credentials leak. No evidence of secrets management or server-side injection pattern.
No pagination or result limits on GetSchema. If database has 10,000+ tables with hundreds of columns each, response could exceed context window. Missing: limit parameter, pagination cursor, and explicit statement of max result size in description.
Tool descriptions are 34-67 characters (below 10-char floor for some). GetSchema at 65 chars, Query at 79 chars, HealthCheck at 72 chars, all underexplain when to use each tool vs alternatives. Baseline for A+ tools is 194 chars average.
No per-tool permission gates or destructive/idempotent hints. Query tool risk is marked as WRITE but tool definition carries no metadata (destructiveHint annotation) to warn agents. Tool names do not disambiguate GetSchema (read-only) vs Query (write-capable).
Idempotency not guaranteed. If Query tool fails mid-transaction and is retried, transaction is rolled back (line 'transaction.Commit()' only happens on success). But GetSchema and HealthCheck do not explicitly document idempotency. An agent retrying GetSchema twice should return identical results, but no code guarantees this.