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.

Every one of the 19 MSSQL MCP Server tools returns a DbOperationResult object. The shape is consistent across read, write, and AI Insights operations, with tool-specific payload carried in the data field. This predictable envelope makes it straightforward for MCP clients and LLM agents to detect failures, count affected rows, and extract structured results without tool-specific parsing logic.

Core fields

success
boolean
required
Whether the operation completed without error. A true value means the SQL was executed and the result was serialized successfully. A false value means something went wrong — check error for the message.
error
string | null
Human-readable error message when success is false. Set to null on success. Errors include connection failures, SQL classification rejections (e.g. passing a SELECT to ExecuteSQL), permission errors, and runtime exceptions.
rowsAffected
integer | null
Populated by DML tools: InsertData, UpdateData, and ExecuteSQL. Reflects the integer returned by the underlying ADO.NET ExecuteNonQuery call. null for read-only tools and insight query tools that do not modify rows.
data
object | array | null
Tool-specific payload. The shape varies by tool:
  • Read tools (ReadData, ListObjects) — an array of row objects.
  • Introspection tools (DescribeTable, DescribeView, GetObject) — a metadata object; when the AI Insights layer is enabled, additional top-level keys are merged in (see Insight metadata fields below).
  • DML tools (InsertData, UpdateData, ExecuteSQL) — typically null or a minimal confirmation object; row count is in rowsAffected.
  • Insight tools (GetInsight, InsightsCheck, etc.) — a structured object specific to each insight operation.

Example responses

Successful read — ReadData / ListObjects

{
  "success": true,
  "error": null,
  "rowsAffected": null,
  "data": [
    { "TABLE_SCHEMA": "dbo", "TABLE_NAME": "Orders", "TABLE_TYPE": "BASE TABLE" },
    { "TABLE_SCHEMA": "dbo", "TABLE_NAME": "Customers", "TABLE_TYPE": "BASE TABLE" }
  ]
}

Successful DML — InsertData

{
  "success": true,
  "error": null,
  "rowsAffected": 1,
  "data": null
}

Error response

{
  "success": false,
  "error": "ExecuteSQL does not allow SELECT or other read-only queries. Use ReadData for all SELECT statements, including sys.*, INFORMATION_SCHEMA, and DMVs.",
  "rowsAffected": null,
  "data": null
}

Insight metadata fields

When the AI Insights layer is enabled (USE_INSIGHTS_LAYER is not set to a falsey value), the introspection tools DescribeTable, DescribeView, and GetObject merge the following top-level keys into their data payload. This is a best-effort enrichment — a failure to read insight metadata never causes the parent tool call to fail.
insight
object | null
The cached SchemaInsight row projected for API response. null when no cached insight exists for the object and auto-population did not produce one. See SchemaInsight fields below for the full field list.
insightFreshness
string
Freshness classification of the cached insight. One of:
ValueMeaning
FreshCached insight matches the live object definition (fingerprint + modify_date).
AbsentNo row in AIInsights.SchemaInsights; a baseline may be created on the next introspection if auto-population is enabled.
StaleArchivedCached row was archived to InsightHistory due to DDL change or fingerprint drift.
LayerDisabledUSE_INSIGHTS_LAYER=false; insight enrichment was skipped.
AccessDeniedCould not read the live object definition due to insufficient permissions.
DefinitionUnavailableObject exists but its definition could not be resolved.
enrichmentSuggested
boolean
true when the cached insight is an auto-mechanical baseline (LlmModel = "auto-mechanical", Confidence = 0.30). Signals to MCP-aware agents that the insight should be upgraded via UpsertInsight before answering the user.
insightEnrichment
object | null
Full enrichment directive, present only when enrichmentSuggested is true and INSIGHTS_AUTOPOPULATE is enabled. Includes a pre-filled UpsertInsight argument template (with <fill in: …> placeholders), a list of related objects to introspect, enrichment instructions, and completion criteria. Conforms to protocol MCP-Insight-Enrichment-v1.
_agentDirective
string | null
Mandatory instruction text injected when enrichment is required. Present only when enrichmentSuggested is true. Instructs the agent to call UpsertInsight for the current object (and any relatedObjectsToIntrospect) before producing a final answer to the user. Skipping this call is flagged as a protocol violation.
pendingEnrichments
array | null
List of objects requiring UpsertInsight calls, each entry containing tool, target, objectType, and reason. Present alongside _agentDirective when enrichment is required.

SchemaInsight fields

Build docs developers (and LLMs) love