Skip to main content
Glama
Andrian17

mssql-mcp-server

by Andrian17

mssql_manage_rls

Create, edit, enable, disable, or drop SQL Server row-level security policies using predicate functions to restrict data access.

Instructions

Manage SQL Server Row-Level Security - security policies with generated predicate functions. Examples: operation="create_policy" with tableName, policyName, predicateColumns=["TenantId"], using="@TenantId = CAST(SESSION_CONTEXT(N'TenantId') AS int)"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleNoNot supported: SQL Server policies apply to all principals
checkNoBLOCK predicate expression over @Column parameters (optional)
rolesNoNot supported: SQL Server policies apply to all principals
usingNoFILTER predicate expression over @Column parameters (required for create_policy unless command is INSERT/UPDATE/DELETE)
schemaNoSchema name (defaults to dbo)
commandNoWhich block operations the check predicate applies to (SELECT = filter only)ALL
replaceNoDrop and recreate the policy if it exists (for create_policy)
ifExistsNoInclude IF EXISTS clause (for drop_policy)
operationYesOperation: enable/disable policies on a table, create_policy, edit_policy, drop_policy, get_policies
tableNameNoTable name (required for enable/disable/create_policy/edit_policy, optional filter for get_policies)
policyNameNoPolicy name (required for create_policy/edit_policy/drop_policy)
connectionStringNoSQL Server connection string (optional; requires --allow-tool-connection-string)
predicateColumnsNoColumns passed to the predicate functions; reference them as @Column in using/check

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations provided, the description must carry behavioral disclosure, but it only says 'Manage' and 'generated predicate functions'. It does not mention that create/edit/drop/replace operations are persistent DDL changes, that get_policies is a read operation, or that connectionString requires an explicit flag. Even the replace and ifExists behaviors are left entirely to the schema rather than the description.

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

Conciseness4/5

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

The description is brief and front-loaded: the purpose is stated first, followed by a single illustrative example. There is no filler, but the example's internal inconsistency slightly tarnishes its structural value.

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

Completeness3/5

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

The tool is complex (13 params, 6 operations, no output schema) and has no annotations, yet the description is quite sparse. It provides a high-level orientation and one create_policy example, while the rich schema descriptions cover the operational details; however, it omits any sense of what operations return and does not orient the agent to edit/drop/get flows, making it only minimally complete.

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

Parameters2/5

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

The schema covers all 13 parameters (100%), setting a baseline of 3, but the description's attempt to illustrate parameter use is flawed: it uses predicateColumns=['TenantId'] while the using expression references '@TenId', contradicting the schema rule that columns are referenced as @Column. This mismatch could lead an agent to generate an invalid predicate, so the example does more harm than good.

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?

The description states a specific domain ('SQL Server Row-Level Security') and an actionable verb ('Manage'), and reinforces it with a concrete create_policy example that names the key parameters. Among eighteen sibling tools, only this one targets RLS policies, so it is clearly distinguishable.

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 example demonstrates a valid invocation (operation='create_policy', tableName, policyName, predicateColumns, using), which gives an agent a concrete usage pattern. However, it never explicitly says when to prefer this tool over the many other mssql_manage_* siblings, or when not to use it. The guidance is implied by the RLS scope rather than stated.

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