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.
UpsertInsight creates or updates an insight row for a database object in AIInsights.SchemaInsights. It is the primary mechanism for agents to upgrade auto-mechanical baselines with real LLM-authored summaries. The implementation runs UPDATE first and falls back to INSERT only when no matching row exists. The schema fingerprint and object_id of the live object are captured automatically server-side at write time — callers do not provide these values.
Parameters
Object type label to store in
AIInsights.SchemaInsights. Must be one of: Table, View, Procedure, Function, Trigger.Schema name of the object. Pass
dbo for the default schema. Pass null only when the schema is genuinely unknown.Object name without schema prefix (e.g.
TableProblems).Short single-sentence description of what this object is.
Why this object exists from a business or operational perspective. Pass
null to skip.Data patterns: typical volume, key columns, hot filters, and partitioning hints. Pass
null to skip.Usage guidance for analysts and agents: preferred joins, filters, and gotchas. Pass
null to skip.Related objects as a JSON array string, e.g.
'["Buildings","Suppliers"]'. Pass null to skip.Identifier of the LLM or process that produced the insight (e.g.
gpt-4o, claude-3-5-sonnet, manual-validation). Stored for provenance. Defaults to unknown.Confidence score between
0 and 1. Use 0.8 as a sensible default for a properly authored insight. Defaults to 0.8.Name or identifier of the agent, analyst, or process that authored the insight (e.g.
investigation-agent, JIRA-1234). Defaults to MCP.Column name when authoring a column-level insight. Pass
null (or omit) for table- or object-level insights.Fingerprint
The schema fingerprint is computed server-side at write time from livesys.* metadata. You do not need to supply or calculate it. The fingerprint is used by subsequent GetInsight calls to detect whether the object has been altered since the insight was written.
Returns
true when the row was written successfully; false on error.Present when
success is true. Contains a confirmation message and the insight ID of the written row.Present only when
success is false. Contains the exception message.UpsertInsight requires USE_INSIGHTS_LAYER to be enabled (the default) and the AI Insights layer to be installed via InstallInsightsLayer. When the layer is disabled, the tool returns an error without writing to the database.