Skip to main content
Glama
toby7979

sealmyapp

by toby7979

Safe RLS policy template

rls_policy_template
Read-onlyIdempotent

Generate Supabase RLS policy examples for select/insert/update/delete using auth.uid(), with owner-based defaults and caveats; avoids using(true) on private data.

Instructions

Return example Supabase RLS policies (select/insert/update/delete using auth.uid()) for a common table shape, with caveats. Never uses using (true) on private data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_kindYesThe shape of the table.
owner_columnNoColumn holding the owner's user id. Defaults: profiles=id, posts/orders=user_id, messages=sender_id. Ignored for files.

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 establish readOnly/idempotent/non-destructive/closed-world. The description still adds real value by disclosing the content policy of what it generates: policies use auth.uid() and it 'never uses `using (true)` on private data', plus it returns caveats. It doesn't describe response shape, but the safety guarantee is the more decision-relevant trait.

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 tight sentences with zero waste; the return content is front-loaded and the caveat about `using (true)` closes as a useful qualifier rather than 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 read-only, two-parameter template generator with full schema coverage and annotations covering the safety profile, the description tells the agent what comes back (example policies with caveats). No output schema exists, so explaining the returned artifact was the main remaining burden and it is largely handled.

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% – table_kind's enum and owner_column's defaults (profiles=id, posts/orders=user_id, messages=sender_id, ignored for files) are already fully documented in the schema. The description adds no parameter detail, so the baseline of 3 applies.

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 names a specific verb and resource: 'Return example Supabase RLS policies (select/insert/update/delete using auth.uid())'. This separates it in spirit from the audit-oriented sibling supabase_rls_audit_sql, though it never names an alternative explicitly.

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?

'for a common table shape' implies the intended scenario – scaffolding boilerplate policies for standard tables – but there is no explicit when-to-use, when-not-to-use, or pointer to a sibling such as supabase_rls_audit_sql for verifying existing policies. Usage must be inferred.

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