Skip to main content
Glama
shadow-dba

mssql-dba-mcp

by shadow-dba

Get DB Table Keys

mssql_db_table_keys
Read-onlyIdempotent

Audit SQL Server table keys: list row counts, heap or clustered indexes, primary keys, and unique indexes, flagging heaps, missing primary keys, and tables with no unique index beyond the primary key.

Instructions

Table keys: every user table with row count, heap or clustered index, primary key and other unique indexes. Flags heaps, tables without a primary key, and tables where only the primary key is unique. onlyFlagged=true (default) returns only flagged tables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
onlyFlaggedNoReturn only tables with a flag. Set false to return all tables.
databaseNameNoTarget database. Defaults to connected database.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds useful behavioral context by explaining what is flagged and how onlyFlagged changes the result set, though it says nothing about permissions, performance, or result ordering.

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?

The description is compact and front-loaded: it defines the resource and returned fields first, then explains flagging behavior, then states the onlyFlagged default. Every sentence carries useful information with 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?

There is no output schema, so the description must carry return-value information. It does list the key returned fields and flag conditions, making it mostly complete, but it does not describe the exact output structure, column names, or ordering.

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?

Schema description coverage is 100%, so both parameters are already documented in the input schema. The description repeats onlyFlagged's default and effect but adds no extra semantic detail beyond what the schema provides, which is the baseline 3 when schema does the heavy lifting.

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

Purpose4/5

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

The description states the resource (table keys) and specifies the exact contents: user tables with row count, heap or clustered index, primary key, unique indexes, and flags for heaps/missing PK/single-column uniqueness. It is clear, but it does not explicitly differentiate itself from sibling tools like mssql_db_tables or mssql_db_index_health.

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

Usage Guidelines3/5

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

The description implies usage through its diagnostic flagging logic and the onlyFlagged default, which tells the agent this is for finding key/index design problems. However, it never states when to choose this tool over similar siblings such as mssql_db_tables, mssql_table_info, or mssql_db_index_health.

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