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 enrichment protocol is a tool-call contract built directly into the MSSQL MCP Server. When the server detects that a database object has only an auto-mechanical baseline insight — a server-generated placeholder with LlmModel = "auto-mechanical" and Confidence = 0.30 — it embeds a mandatory directive in the introspection response that requires the calling agent to upgrade the cache entry before producing its final answer to the user. This contract is identified as MCP-Insight-Enrichment-v1 and is enforced through structured fields in the response payload, not through a separate handshake.

Trigger signals

An enrichment obligation is active whenever ANY of the following appear in a response from DescribeTable, DescribeView, or GetObject:
SignalLocation in responseMeaning
_agentDirectivetop-level stringHuman-readable mandatory instruction naming the target object
pendingEnrichmentstop-level arrayList of { tool, target, objectType, reason } items to process
insightEnrichment.requirednested booltrue — the obligation is explicitly set
enrichmentSuggestedtop-level booltrue — shorthand flag indicating a baseline row was returned
If any one of these signals is present, the enrichment obligation is unfulfilled. The agent must not write a user-facing answer until it has completed the steps below.

Enrichment steps

1

Call UpsertInsight for the primary object

Use the object in insightEnrichment.nextAction.args as your call template. Replace every <fill in: ...> placeholder with real values derived from the metadata returned in the same introspection response — column names, indexes, foreign keys, row counts, definition text, and anything else that conveys the object’s actual purpose and structure.Do not pass llmModel="auto-mechanical" — that is the placeholder value you are replacing. Do not pass confidence <= 0.30 — the whole point of this call is to increase confidence above that threshold. A typical authored insight uses confidence: 0.85.
2

Introspect and enrich related objects

For each entry in insightEnrichment.relatedObjectsToIntrospect, call the matching introspection tool:
  • DescribeTable for tables
  • DescribeView for views
  • GetObject (with the appropriate objectType) for stored procedures, functions, or triggers
After each call, check the response for the same trigger signals listed above. If any are present, repeat the enrichment loop for that object before moving on. Related objects that are never introspected will have zero insight rows — a worse outcome than a stale auto-mechanical baseline.
3

Write the final answer

Only after UpsertInsight has been called for every object in the primary response and every entry in relatedObjectsToIntrospect should the agent produce its final answer to the user. All enrichment calls must complete first.

Why this matters

Auto-mechanical baselines are confidence 0.30 placeholders. They exist solely to give the cache something for the next agent session — a row is better than no row. But they contain no domain knowledge: the description is a template string, the business purpose is a boilerplate sentence, and the data patterns field holds raw sys.* metadata as JSON. If an agent skips the enrichment loop, the SchemaInsights row stays at LlmModel = "auto-mechanical" and Confidence = 0.30 indefinitely. Every future agent that introspects the same object will see enrichmentSuggested = true again and re-investigate the object from scratch, spending the same tokens all over again. The cache never improves. When enrichment is performed correctly, the next agent session finds a Fresh insight with real authored context and skips the re-investigation entirely.

insightEnrichment block fields

The insightEnrichment object in the introspection response contains the following fields:
FieldTypeValue / Description
requiredboolAlways true when the block is present
prioritystring"MUST"
protocolstring"MCP-Insight-Enrichment-v1"
reasonstringHuman-readable explanation naming the model and current confidence
contractstringExplicit statement of the tool-call obligation for the primary object
consequenceOfSkippingstringDescription of the cache degradation that results from skipping
instructionsarray of stringsNumbered steps describing the enrichment procedure
completionCriteriastringThe condition that satisfies the obligation (see Note below)
relatedObjectsToIntrospectarray of stringsQualified names of related objects that also need introspection
nextAction.toolstringAlways "UpsertInsight"
nextAction.argsobjectPre-filled UpsertInsight parameters with <fill in: ...> placeholders

UpsertInsight args template

The nextAction.args object is constructed server-side from the baseline row and looks like this. Every <fill in: ...> field must be replaced with real authored content before the call is made:
{
  "objectType": "<from response>",
  "schemaName": "<from response>",
  "objectName": "<from response>",
  "description": "<fill in: one short sentence>",
  "businessPurpose": "<fill in: why this object exists>",
  "dataPatterns": "<fill in: volume/keys/hot filters>",
  "usageGuidelines": "<fill in: preferred joins/filters and gotchas>",
  "relatedObjects": "[]",
  "llmModel": "<fill in: model id (NOT 'auto-mechanical')>",
  "confidence": 0.85,
  "analyzedBy": "<fill in: agent name>",
  "columnName": null
}
objectType, schemaName, and objectName are already populated from the baseline row. The relatedObjects field is also pre-filled with the JSON array of related object names parsed from the baseline. The fields marked <fill in: ...> must be replaced; passing the placeholder strings through to the database will produce a misleading insight row and leave the obligation technically unfulfilled.
The completionCriteria field states exactly when the obligation is satisfied: the AIInsights.SchemaInsights row for the object must have LLMModel != 'auto-mechanical' and Confidence > 0.30. You can verify this with GetInsight after upserting, or by checking insightFreshness = "Fresh" on the next introspection call.

Build docs developers (and LLMs) love