mcpField
R
retool-query

retool-query

github.com/civitaiData & databases7.3k59 installsUpdated today
Repository

About retool-query

retool-query is a command-line skill for querying the moderator PostgreSQL database, including Retool-era moderation and xguard-lab tables. It is intended for developers investigating moderation data, with writes blocked unless explicitly enabled after user permission.

Key features

  1. 01Query PostgreSQL with SQL
  2. 02Read queries by default
  3. 03Require permission for writes
  4. 04Set timeouts and output JSON
  5. 05Load SQL from a file

Use cases

  1. 01Inspect the UserNotes table schema
  2. 02Look up a user's moderation notes
  3. 03Investigate Retool-era moderation data
  4. 04Add moderation notes with permission

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/civitai/civitai --skill retool-query

After installing, type/retool-queryin Claude Code to confirm it loaded.

Bundled files.env.examplequery.mjs

Details

From the project README

Moderator Database Query

Queries the moderator PostgreSQL database — MODERATOR_DATABASE_URL, one instance since the 2026-08-21 consolidation, holding the Retool-era moderation tables (UserNotes, UserStrikes, ReToolActions, …) alongside the xguard-lab tables.

Running Queries

node .claude/skills/retool-query/query.mjs "SELECT * FROM \"UserNotes\" LIMIT 5"
Options
FlagDescription
--writableAllow write operations (requires user permission)
--timeout <s>, -tQuery timeout in seconds (default: 30)
--file, -fRead query from a file
--jsonOutput results as JSON
--quiet, -qMinimal output, only results
Examples
# List tables
node .claude/skills/retool-query/query.mjs "SELECT tablename FROM pg_tables WHERE schemaname = 'public'"

# View UserNotes schema
node .claude/skills/retool-query/query.mjs "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_name = 'UserNotes'"

# Look up notes for a user
node .claude/skills/retool-query/query.mjs "SELECT * FROM \"UserNotes\" WHERE \"userId\" = 12345 ORDER BY created_at DESC LIMIT 10"

# JSON output
node .claude/skills/retool-query/query.mjs --json "SELECT * FROM \"UserNotes\" LIMIT 3"

Safety Features

  1. Read-only by default: Blocks write operations unless --writable flag is used
  2. Explicit permission required: Before using --writable, you MUST ask the user for permission
  3. Timeout protection: 30-second default timeout

When to Use

  • Exploring the UserNotes table schema
  • Looking up moderation notes for a specific user
  • Writing new moderation notes (with --writable)
  • Investigating Retool-era moderation data

Comments

Markdown supported