Skip to main content
Glama

add_dynamic_rls

Generate dynamic row-level security by creating a role (if needed) and setting a USERPRINCIPALNAME()-driven filter on a target table, supporting direct, bridge, hierarchy, or lookup shapes.

Instructions

Generate dynamic row-level security: create the role (if absent) and set a USERPRINCIPALNAME()-driven filter on the SECURED table. shape = direct | bridge | hierarchy | lookup. Never targets the user/mapping table (refused - it would break the lookup).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleYesrole name
shapeYesdirect | bridge | hierarchy | lookup
sessionIdYes
userTableYesthe user/security mapping table
pathColumnNopath column on the user table for the hierarchy shape (optional)
securedTableYesthe fact/dimension table to secure
securedColumnYesthe column on the secured table to filter
modelPermissionNomodel permission for a new role (default Read)
userEmailColumnYesthe email/UPN column on the user table
userValueColumnYesthe value column on the user table that matches the secured column
Behavior4/5

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

With no annotations provided, the description covers key side effects: role creation is conditional ('if absent'), the filter is UPN-driven, and the user/mapping table is explicitly refused. It does not mention whether an existing role's filter is overwritten or what happens to permissions, but the provided behaviors are meaningful and non-obvious.

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 two sentences, front-loaded with the primary purpose, and each sentence adds distinct value. The shape enumeration and refusal note are compact and directly relevant.

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 with 10 parameters and no output schema, and the description does not explain the key shape semantics (direct vs bridge vs hierarchy vs lookup), nor handling of existing roles or permission defaults. The refusal behavior and high schema coverage help, but significant behavioral gaps remain for such a configurable tool.

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 high at 90%, so the baseline is 3. The description adds context beyond the schema by explaining the UPN-driven filter and the refusal case, but it does not elaborate on the meaning of each shape or how parameters like pathColumn and modelPermission interact.

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 clearly states the tool generates dynamic row-level security by creating a role and setting a USERPRINCIPALNAME()-driven filter. It specifies the resource (SECURED table) and the action (create role + set filter), and the 'dynamic' qualifier plus refusal behavior distinguishes it from static RLS or role-management siblings, though no sibling is explicitly named.

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 for dynamic RLS scenarios and lists the shape enum to guide configuration, but it does not explicitly say when to prefer this tool over alternatives like set_rls or add_role. The refusal to target the user/mapping table is a clear exclusion, but there is no direct comparison to sibling tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyphonica/powerbi-pbix-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server