Skip to main content
Glama
shadow-dba

mssql-dba-mcp

by shadow-dba

Get DB Check Constraint Health

mssql_db_check_constraints
Read-onlyIdempotent

Detect untrusted or disabled SQL Server check constraints and provide the WITH CHECK CHECK CONSTRAINT fix to restore optimizer trust and reveal invalid rows.

Instructions

Check constraints that are untrusted or disabled, with the ALTER TABLE ... WITH CHECK CHECK CONSTRAINT fix. The optimizer ignores untrusted constraints, and they may hide invalid rows. For foreign keys use mssql_db_foreign_keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNameNoTarget database. Defaults to connected database.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint/idempotentHint, so the safety profile is covered; the description adds the operational impact (optimizer ignores untrusted constraints, invalid rows may be hidden) and the remediation script pattern. It does not describe the result set shape, but no output schema exists and the purpose is narrow.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences: the first gives purpose plus remediation, the second gives impact plus sibling routing. No filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-optional-param read-only diagnostic, the description covers purpose, impact and disambiguation adequately. Minor gap: the remediation is presented as guidance, and the description doesn't clarify that this tool only reports the fix script rather than applying it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Single parameter with 100% schema description coverage, so the schema fully documents databaseName and its default. The description adds no additional parameter semantics, which is the expected baseline here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (find check constraints that are untrusted or disabled) and explicitly distinguishes its scope from the foreign-key sibling, mssql_db_foreign_keys. An agent can select it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names the alternative tool and the condition that selects it (foreign keys). It also implies when the results matter (optimizer ignores untrusted constraints). It lacks an explicit when-not clause beyond the foreign-key routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.