Every tool and prompt pg_licht 4.3.3 offers: 68 read-only tools in 10 groups, and 12 guided prompts. Each page is generated from the binary itself.
primary or replica.These five names are read by the server itself, out of the arguments of every call. A tool that declares an argument of its own by one of those names keeps it — roleDependencies takes a role, naming the role to ask about — and cannot be targeted by that selector. The tool's argument wins, in its published schema and in the call alike.
| Tool | What it answers |
|---|---|
| checkPrivileges | Report which tools the current role can actually use on this connection, and how the rest fall short. |
| roleDependencies | Return what depends on one role, cluster-wide, from pg_shdepend. |
| defaultPrivileges | Return ALTER DEFAULT PRIVILEGES entries (pg_default_acl): what grants the NEXT object of each type will get, per granting role and per schema. |
| checkRoleAccess | Answer whether one role holds privileges on one table, view, sequence, function or procedure -- as PostgreSQL evaluates it, via has_table_privilege and its relatives, so role inheritance, grants to PUBLIC, ownership and superuser are all folded in the way the server folds them… |
| Tool | What it answers |
|---|---|
| listSchemas | Return schema list with basic summaries: table_count, up to 25 table names, and role grants per schema. |
| listTables | Return the structure of every table, view and materialised view in a schema: kind, comment, storage options, columns and their per-column index counts, index count and constraint count. |
| tableDetails | Return the structure of one table: columns with types, defaults, storage and compression, primary key, indexes with their definition and whether each is valid, constraints, foreign keys, inbound foreign keys (referenced_by), triggers with their enabled state, rules, row-level… data values |
| tableStats | Return the statistics PostgreSQL keeps for one table: estimated row count, seq_scan and idx_scan counts, live and dead tuples, rows modified since the last analyze, rows inserted since the last vacuum, the manual and automatic vacuum and analyze times as four separate fields… data values |
| largeObjects | Return how many large objects this database holds and who owns them (pg_largeobject_metadata). |
| listPartitions | Return every partitioned table in a schema with its partitioning strategy (range/list/hash), the partition key, how many partitions it has, the combined estimated row count and size of every leaf partition at any depth (a sub-partitioned child holds nothing itself), whether a… |
| partitionDetails | Return one partitioned table with every partition: its bound expression verbatim, whether it is the DEFAULT, whether it is itself partitioned, estimated rows and size (both null, not 0, for a partition never analyzed), and the per-partition live/dead tuples, scan counters and… |
| listTableStats | Return the statistics PostgreSQL keeps for every table in a schema: estimated row count, seq_scan and idx_scan counts, live and dead tuples, rows modified since the last analyze, rows inserted since the last vacuum, and the manual and automatic vacuum and analyze times as four… |
| tableSize | Measure one table on disk: main fork, total table size including TOAST and the free space and visibility maps, index size, grand total, the TOAST relation and each index individually. |
| listTableSizes | Measure every table in a schema on disk: table size, index size and grand total per relation. |
| listFunctions | Return function and procedure list for a schema. |
| functionDetails | Return detailed function or procedure info including source and trigger usage. data values |
| listEnums | Return enum type list for a schema with their values and descriptions. |
| enumDetails | Return enum type details including values and which columns use it. |
| listTypes | Return composite type, domain, and range type list for a schema (excludes enums and implicit table/view row types); composites include their attribute list, domains include base type/nullability/default/constraints, ranges include subtype and the auto-generated multirange type… |
| typeDetails | Return composite type, domain, or range type details including attributes/constraints/subtype and which columns use it. |
| columnHistogram | Return the whole value distribution of one column: the most common values with their frequencies, and the full histogram of everything else. data values |
| listExtendedStatistics | Return extended statistics objects (CREATE STATISTICS) for a schema with target table, columns, the statistics kinds declared (ndistinct, dependencies, mcv, expressions), and description -- plus whether they have actually been BUILT. |
| listSequences | Return sequence list for a schema with type, range, increment, cycle, cache, current value, and owning table.column (for SERIAL/IDENTITY columns). |
| Tool | What it answers |
|---|---|
| searchTables | Find tables across every non-system schema by full-text search over table names, comments, column names and comments, enum labels and grantee names, and return their structure. |
| searchFunctions | Search functions and procedures by name, source, language, trigger name, or description. |
| searchEnums | Search enum types by name, values, or description. |
| Tool | What it answers |
|---|---|
| listRoles | Return cluster-wide roles with kind (login/group), attributes (superuser, create_role, create_db, replication, bypass_rls, connection_limit, valid_until), and group memberships. |
| listTablespaces | Return cluster-wide tablespaces with owner, filesystem location, options, and description. |
| listEventTriggers | Return cluster-wide event triggers with event type, tags, function, owner, enabled status, and description. |
| listLanguages | Return procedural languages installed in the current database (e.g. plpgsql, plpython3u) with owner, trusted/procedural flags, handler function, and description. |
| listAccessMethods | Return index and table access methods available in the cluster (btree, gist, gin, heap, etc) with type and handler function. |
| listCasts | Return type casts involving at least one user-defined type (excludes built-in-to-built-in casts) with source/target types, context (implicit/assignment/explicit), and method. |
| listExtensions | Return installed PostgreSQL extensions with version, schema, relocatable flag, and description. |
| Tool | What it answers |
|---|---|
| listCollations | Return collations usable in the current database's encoding for a schema, with provider, locale settings, and determinism flag. |
| listOperators | Return custom operators in a schema with left/right operand types, result type, and implementing function; mostly relevant for schemas using extensions with custom types (e.g. PostGIS). |
| listOperatorClasses | Return operator classes in a schema with their index access method, input type, and default flag; describes what index types (btree/gist/gin/etc) a type supports. |
| listTextSearchConfigs | Return full-text search configurations for a schema with parser and the token-type-to-dictionary mapping. |
| Tool | What it answers |
|---|---|
| replicationStats | Return every WAL sender on this server (pg_stat_replication) with its state, sync_state, sent/write/flush/replay LSNs, the byte gap to replay (on a cascading standby, measured from the WAL it has received), and write_lag/flush_lag/replay_lag as SECONDS -- plus replication… |
| listForeignTables | Return foreign tables in a schema with their foreign server, FDW, options, and columns (does not expose user mapping credentials). |
| listForeignServers | Return cluster-wide foreign servers with their FDW, owner, and options (host/port/dbname-style options only, never user mapping credentials). |
| listPublications | Return logical replication publications with owner, all-tables flag, per-operation flags (insert/update/delete/truncate), table_count, up to 50 member table names, and on PostgreSQL 15+ the schemas published wholesale via FOR TABLES IN SCHEMA. |
| listSubscriptions | Return logical replication subscriptions for the current database with owner, enabled status, publications, slot name, and sync settings (never exposes the connection string, which may contain credentials). |
| subscriptionStats | Return the runtime state of every logical replication subscription in this database: each worker with its type, pid, the relation it is syncing and how long since it last heard from the publisher; per-table sync state, with the tables that are not yet ready listed individually… |
| replicationSlots | Return replication slots with retained WAL bytes; a lagging or unused slot holds back WAL indefinitely and is a common cause of disk bloat incidents. |
| Tool | What it answers |
|---|---|
| diskUsage | Report what PostgreSQL is holding on disk without needing a shell on the server: WAL directory size and file count, the archive status backlog, temporary files currently on disk, log directory size, per-tablespace sizes and per-database sizes across the whole cluster. |
| databaseSize | Return the current database name and its total disk size. |
| serverSettings | Return PostgreSQL server settings (pg_settings) grouped by category, each with current value, unit, description, context, type, source, and pending_restart flag. data values |
| currentActivity | Return current server connections and running queries (pg_stat_activity) across all databases: pid, database, user, application_name, backend_type, state, wait event, query text, transaction and query duration, leader_pid for parallel workers, and the backend's xid and xmin. data values |
| currentLocks | Return current locks (pg_locks) joined with the holding backend's query and user, plus which pids are blocking each waiting lock; use to diagnose lock contention. data values |
| databaseStats | Return per-database statistics (pg_stat_database) for every database in the cluster: connections, commits/rollbacks, block hit ratio inputs, tuple counts, conflicts, deadlocks, temp file usage, and checksum failures. |
| statementStats | Return tracked queries from pg_stat_statements under 'statements', with calls, timing, row counts, buffer usage, temporary block I/O and WAL volume, alongside an 'info' block from pg_stat_statements_info whose dealloc counter says whether entries are being evicted -- if it is… data values |
| wraparoundStatus | Return transaction id and multixact wraparound headroom: age(datfrozenxid) and age(datminmxid) for every database, the oldest tables by age(relfrozenxid) including TOAST tables (often the relation actually holding the horizon back), each xid and multixact age as a percentage of… |
| progressStats | Return every long-running maintenance command currently reporting progress (pg_stat_progress_vacuum, _analyze, _create_index, _cluster, _copy, _basebackup), with the phase, the blocks or tuples done against the total, a completion percentage, and how long it has been running. |
| ioStats | Return cumulative I/O statistics under 'io', per backend type, object and context (pg_stat_io, PostgreSQL 16+): reads, writes, extends, hits, evictions, reuses, fsyncs and their timings, with a hit percentage. |
| checkpointStats | Return checkpoint, WAL, and background writer activity (pg_stat_checkpointer and pg_stat_bgwriter on PostgreSQL 17+, pg_stat_bgwriter alone before that, plus pg_stat_wal) with field names normalized across both shapes: timed versus requested checkpoint counts and the ratio… |
| tableIOStats | Return per-object buffer cache hit ratios (pg_statio_all_tables): heap_blks_read versus heap_blks_hit, idx_blks_read versus idx_blks_hit, the TOAST and TOAST-index pairs, and a combined ratio, with relation size and scan counts. |
| hostCapacity | Correlate memory and parallelism settings with the capacity of the machine PostgreSQL runs on. |
| bufferCacheSummary | Return how much of shared_buffers is used, dirty and pinned, with the usage-count histogram from pg_buffercache. |
| bufferCacheContents | Return which relations own shared_buffers, aggregated per relation and fork and ranked by buffers held: cached bytes, percent of that fork resident, percent of shared_buffers consumed, dirty buffers, average usagecount and pins. |
| Tool | What it answers |
|---|---|
| evaluateIndex | Plan a statement as if the indexes were different, using hypopg. data values |
| duplicateIndexes | Return indexes that duplicate or are covered by another index on the same table. |
| tableBloat | Return physical storage bloat for a table (pgstattuple/pgstattuple_approx): table size, live/dead tuple counts and percentages, free space and percentage. |
| indexBloat | Return physical statistics for one index, from whichever pgstattuple function matches its access method: pgstatindex for btree (tree level, leaf/internal/empty/deleted pages, average leaf density, leaf fragmentation), pgstatginindex for GIN (pending list pages and tuples… |
| checkKey | Check if a row exists by primary key; validates value types against the PK column types before querying. |
| explainQuery | Return the raw EXPLAIN (FORMAT JSON) plan for a statement, either recovered from pg_stat_statements by queryid (full untruncated text) or supplied directly as sql. data values |
| Tool | What it answers |
|---|---|
| verifyTopology | Connect to every configured connection and report what each server actually is: its role (primary or replica, from pg_is_in_recovery(), observed now rather than configured), its system identifier, database, address, port and version -- then check the declared topology against… |
| listTopology | Return the configured topology: which connections share an instance (one postmaster, so they share shared_buffers, WAL, autovacuum workers and disk), which belong to the same replication_group (a primary and its replicas, holding the same data on different servers), and which… |
| Tool | What it answers |
|---|---|
| listConnections | Return the configured database connections by name, with the libpq service name or host/port/dbname/user for each, its instance, replication_group and group labels where configured, and which is the default; passwords are never returned and a service file is never expanded. |
A prompt is a ready-made investigation: the client inserts its text as the opening message, and the model works through the tools it names.
| Prompt | What it works out |
|---|---|
| diagnose-slow-query | Trace a slow statement from pg_stat_statements to a plan and a fix. |
| triage-lock-contention | Find what is blocking what, and who to look at first. |
| diagnose-deadlock | Work out why a logged deadlock happened, from the log entry plus the schema. |
| triage-active-sessions | Find why a server is running more sessions at once than it has CPUs to run them on. |
| triage-disk-space | Find what is filling the disk, and what can safely be freed right now. |
| bloat-and-vacuum-review | Decide whether bloat is real, and whether autovacuum is keeping up. |
| buffer-cache-review | See what is occupying shared buffers and whether it is the right thing. |
| capacity-check | Check memory and parallelism settings against the machine. |
| replication-slot-review | Find what a replication slot is holding back, and what it costs to release it. |
| plan-schema-change | Choose how to apply a DDL change by measuring the table it targets. |
| check-role-access | Work out whether a role can use a table, view, function or procedure, and which rows. |
| explain-and-fix | Explain one statement, establish why it is slow, and propose a fix that is verified rather than guessed. |