Guide · 07

Prompts and resources

Besides tools, NexQL offers your app a set of ready-made tasks (MCP prompts) and a way to attach a table's description to a conversation (MCP resources). How they appear depends on the app: often as slash commands or an attach menu.

Prompts

Each one starts a multi-step task with the right tools. Pick it, fill in the blanks, and the assistant takes it from there.

/health-check

Run a full database health assessment and summarize issues by severity.

/analyze-slow-queries

Find the slowest queries and propose index or rewrite improvements.

/explore-schema

Explore and summarize the database schema around a topic.

  • topic What to explore, e.g. "orders", "user accounts", "billing".
/debug-blocking

Diagnose lock contention and identify the root blocking session.

/write-migration

Draft a safe PostgreSQL migration for a described schema change.

  • change The schema change to implement, e.g. "add soft-delete to orders".
/diff-schemas

Compare two PostgreSQL schemas and summarize structural differences.

  • sourceSchema Current / left schema name (e.g. public).
  • targetSchema Desired / right schema name.
/plan-deep-dive

Deep-analyze a query plan with severity-graded findings.

  • sql The SELECT/WITH query to analyze.
/optimize-table

Analyze a table's indexes, bloat signals, and access patterns; propose improvements.

  • table Table as schema.name, e.g. "public.orders".
/explain-this-query

Explain a SQL query against the live schema and propose plan improvements.

  • sql The SQL SELECT (or other read query) to explain.

Resources

Every table, view, materialized view and function in the schema index is available as a resource, addressed like this:

nexql://{connectionId}/{database}/object/{schema}/{name}

Reading one returns a structural card: columns, keys, indexes and, for views and functions, the definition. Attaching nexql://prod/shop/object/public/orders to a conversation is a quick way to say “this table” without the assistant having to search for it.