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-checkRun a full database health assessment and summarize issues by severity.
/analyze-slow-queriesFind the slowest queries and propose index or rewrite improvements.
/explore-schemaExplore and summarize the database schema around a topic.
topicWhat to explore, e.g. "orders", "user accounts", "billing".
/debug-blockingDiagnose lock contention and identify the root blocking session.
/write-migrationDraft a safe PostgreSQL migration for a described schema change.
changeThe schema change to implement, e.g. "add soft-delete to orders".
/diff-schemasCompare two PostgreSQL schemas and summarize structural differences.
sourceSchemaCurrent / left schema name (e.g. public).targetSchemaDesired / right schema name.
/plan-deep-diveDeep-analyze a query plan with severity-graded findings.
sqlThe SELECT/WITH query to analyze.
/optimize-tableAnalyze a table's indexes, bloat signals, and access patterns; propose improvements.
tableTable as schema.name, e.g. "public.orders".
/explain-this-queryExplain a SQL query against the live schema and propose plan improvements.
sqlThe 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.