Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/A-Point-Systems-ltd/ms-sql-mcp/llms.txt

Use this file to discover all available pages before exploring further.

The MSSQL MCP Server exposes 19 tools through a single partial Tools class. Tools are organised into three categories: read-only inspection, write/DDL, and AI Insights cache management. Every tool — regardless of category — returns a consistent DbOperationResult object containing a success flag, an optional error message, an optional rowsAffected count, and a tool-specific data payload.

Read-only inspection tools

These six tools query system catalogs and user data without modifying any state. They do not require the AI Insights layer to function, but when the layer is enabled they automatically attach cached insight metadata to their responses.
ToolTitlePurpose
ListObjectsList ObjectsLists objects by type: Table, View, StoredProcedure, TableFunction, ScalarFunction, Function, TableTrigger, SysObject. Optional partialName does a LIKE filter on name and schema.name.
DescribeTableDescribe TableFull table metadata: columns (type, nullability, descriptions), indexes, constraints, foreign keys, and triggers.
DescribeViewDescribe ViewView metadata, column list, and full T-SQL definition.
GetObjectGet ObjectStored procedure, function, or trigger: parameters (where applicable) plus definition. objectType accepts StoredProcedure, Function, or Trigger.
ReadDataRead DataAll read-only SELECT and WITH … SELECT queries — including sys.*, INFORMATION_SCHEMA, and DMVs.
GetServerInfoGet Server InfoServer version/edition, hardware DMVs (with graceful degradation), and user-database counts.

Write & DDL tools

These five tools modify schema or data and are marked with MCP capability flags so clients can surface confirmation prompts to users before executing destructive operations.
ToolMCP flagsPurpose
CreateTablewriteRun a CREATE TABLE statement.
DropTablewrite, destructiveRun a DROP TABLE statement. Confirm with the user before calling.
InsertDatawriteRun a single INSERT statement.
UpdateDatawrite, destructiveRun a single UPDATE statement. Always include a WHERE clause.
ExecuteSQLwrite, destructiveDDL/DML only — INSERT, UPDATE, DELETE, MERGE, CREATE, ALTER, DROP, TRUNCATE, EXEC, and similar. SELECT is rejected — use ReadData instead. Multi-batch GO scripts are not supported.

AI Insights tools

Eight tools manage the optional AI Insights cache layer. They read from and write to the AIInsights schema installed by InstallInsightsLayer.
ToolPurpose
InsightsCheckReports layer install state, DDL audit presence, insight row count, and the DDL processing watermark.
InstallInsightsLayerIdempotent install of the AIInsights schema plus SchemaInsights, InsightHistory, DdlChangeWatermark, dbo.DDL_AuditLog, and the DDL_Audit trigger.
GetInsightRead the cached insight and freshness status for one named object.
UpsertInsightCreate or update a cached insight (UPDATE-then-INSERT; schema fingerprint captured server-side).
ListInsightsReturn recent rows from AIInsights.SchemaInsights.
GetInsightHistoryReturn archived rows from AIInsights.InsightHistory.
RefreshInsightsProcess the DDL backlog and fingerprint drift; returns recent summaries.
RebuildBaselineInsightsBulk-warm mechanical baselines (schemaName?, objectType?, take 1–2000).
Insight tools require InstallInsightsLayer to be run once per database before they become functional. When USE_INSIGHTS_LAYER=false, insight-specific tools return errors or empty status, and introspection tools (DescribeTable, DescribeView, GetObject) skip insight enrichment entirely.

Read vs execute routing

The SqlStatementClassifier enforces a strict split between the two SQL-execution tools:
  • ReadData accepts only SELECT statements and read-only WITH … SELECT CTEs. SELECT … INTO is explicitly rejected and routed to ExecuteSQL.
  • ExecuteSQL accepts DDL and DML statements (INSERT, UPDATE, DELETE, MERGE, CREATE, ALTER, DROP, TRUNCATE, EXEC, EXECUTE, GRANT, REVOKE, DENY, BACKUP, RESTORE). Any SELECT or read-only WITH … SELECT is rejected with a message directing the caller to ReadData.
This separation is enforced at the classifier level before any SQL reaches the database driver — it cannot be bypassed by reformatting or commenting out keywords. Comments are stripped and the normalized first keyword determines the routing branch. For full details on what each tool accepts and rejects, see the individual reference pages:

ReadData

Read-only SELECT and CTE queries

ExecuteSQL

DDL and DML execution

Build docs developers (and LLMs) love