When to use it
- "My query returns nothing" (often RLS)
- Random 500s from the API
- Slow pages after data growth
What it looks like
Users say the tasks list is empty after login.
get_logsquery_logslist_tablesexecute_sql+2 moreThe API logs show 200s with 0 rows for /rest/v1/tasks. The RLS policy on tasks checks team_members.user_id = auth.uid(), but the new signup flow never inserts into team_members, so new users see nothing. Fix: insert the membership in the signup trigger (SQL below). Apply on a branch first?
The SKILL.md file
name: supabase-debug-with-logsDebug a Supabase problem, such as API errors, auth failures, slow queries, edge function crashes or realtime and storage issues, from project logs and advisors, then propose a fix. Use when the user reports that something in their Supabase app is failing, slow or returning errors.
Steps
- Pin down the symptom: which feature, the error message or status code, and roughly when.
- Pick the log service that matches:
apifor PostgREST and gateway errors,postgres,auth,storage,realtimeoredge-function. Read recent entries withget_logs, or run a filtered query over a time window withquery_logs. - Read the schema context with
list_tableswhen the error names a table or column. - Common causes to check:
- 401 or 403, or empty results: RLS policies blocking the role. Inspect them with a read-only
execute_sqlonpg_policies. - 500 from PostgREST: a database error, which appears in the postgres logs.
- Slow requests: missing indexes.
get_advisorswith the performance type flags them. - Edge function errors: read the function with
get_edge_functionalongside its logs.
- 401 or 403, or empty results: RLS policies blocking the role. Inspect them with a read-only
- Confirm with a read-only query when you can, such as
explainon the slow query.
Report
Cause, the evidence (log lines, policy or plan), and the fix as SQL or code. Any fix that changes the database or a function waits for the user's approval and follows the schema-change steps.
Supabase tools it uses
get_logsquery_logslist_tablesexecute_sqlAsks firstget_advisorsget_edge_function
Tool list from supabase-community/supabase-mcp source.
FAQ
Why do I get empty results instead of an error?
Row Level Security filters rows silently. This skill checks your policies against the role making the request.
Will it change my database?
No. It reads logs and runs read-only queries; any fix needs your approval.