Skip to main content
Glama

Test Supabase RLS policies

execute_sql_as_role

Verify RLS policies by executing SQL as a Postgres role with JWT claims, all inside a rollback transaction that guarantees no data mutation.

Instructions

Executes a SQL query as a specific Postgres role with JWT claims set, so you can verify RLS policies. Runs inside a ROLLBACK transaction — never mutates data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL query to execute
roleNoPostgres role to SET ROLE to, e.g. 'authenticated', 'anon', 'service_role'authenticated
claimsNoAdditional JWT claims to set, e.g. { "role": "parent" }. Merged into request.jwt.claims.
user_idNoUUID to set as request.jwt.claims sub (auth.uid()). Required for RLS policies that check auth.uid().
timeout_secondsNo
connection_stringYesPostgres connection string, e.g. postgresql://postgres:password@localhost:54322/postgres
Behavior4/5

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

No annotations exist, so the description must disclose behavior. It explicitly states the tool runs inside a ROLLBACK transaction and never mutates data—a critical safety guarantee. It also mentions setting JWT claims. It does not cover error handling or timeout behavior, but the core safety trait is transparently disclosed.

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 sentences with no fluff: the first states what and why, the second highlights the safety behavior. The purpose is front-loaded, making it easy for an agent to quickly grasp the tool's value.

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?

Given the tool's complexity (role switching, nested claims) and no output schema, the description covers purpose and safety well. It does not mention return values (e.g., query results) or prerequisites like a running database, but these are implied. Slightly more context on expected output would make it fully complete.

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 coverage is 83%, so most parameters are already documented. The description adds no extra parameter meaning beyond the schema. The uncovered parameter (timeout_seconds) is not mentioned, but with high schema coverage, the baseline of 3 is appropriate.

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 clearly states the verb (Executes), the resource (SQL query), and the purpose (verify RLS policies). It adds specificity with role and JWT claims, and the purpose distinguishes it from unrelated sibling tools like run_e2e_tests or typecheck.

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 usage is implied: 'so you can verify RLS policies' indicates when to use. The ROLLBACK safety note suggests it's safe for testing. However, it does not explicitly state when not to use it or mention alternatives, though siblings are irrelevant. The guidance is clear but not exhaustive.

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/briancox730/dev-tools-mcp'

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