工具 API

inspect_database

Run one read-only neon inspect db check (pick `check` from the input schema). Not for arbitrary SQL (`run_sql`), one statement's plan (`explain_sql_statement`), or applying indexes (`prepare_query_tuning`). Omit `database_name` to cover every database; some checks are compute-wide. If a check needs an extension, the tool names `CREATE EXTENSION`; ask before running it.

devOAuth1 积分

调用信息

工具标识
mcp-server-neon.inspect_database
服务提供方
Neon
平均响应
0 ms
近 7 天调用
0

输入参数

check必填

Which diagnostic to run: `table-sizes`: Size of each table (including TOAST), largest first (pg_table_size) `index-sizes`: Size of each index, largest first (pg_relation_size) `unused-indexes`: Non-unique indexes with fewer than 50 scans — candidates for removal (pg_stat_user_indexes) `seq-scans`: Number of sequential scans recorded against each table (pg_stat_user_tables) `long-running-queries`: Queries running longer than 5 minutes (pg_stat_activity) `stalled-queries`: Active queries running longer than 30 seconds with parallel-worker grouping, waits, and blockers, oldest query group first (compute-wide) `locks`: Locks held with the acquiring query and its age (pg_locks + pg_stat_activity) `outliers`: The 25 queries with the highest cumulative execution time since statistics were last reset (needs pg_stat_statements) `calls`: The 25 most frequently executed queries since statistics were last reset (needs pg_stat_statements) `lfc-hit-rate`: Local File Cache hit rate (compute-wide, needs neon extension) `working-set`: Estimated working set vs LFC size (compute-wide, needs neon extension) `vacuum-stats`: Autovacuum status per table: last (auto)vacuum, dead tuples, threshold `bloat`: Estimated bloat for the 25 most bloated tables (statistical estimate, no extension needed) `replication-slots`: Replication slots (compute-wide): kind, status, client, restart/confirmed-flush LSNs, and lag (pg_replication_slots + pg_stat_replication) `subscriptions`: Per-table logical replication progress on this subscriber (pg_subscription_rel)

project_id

The ID of the project to inspect. Required for an unscoped connection. May be omitted when the connection is scoped to one project; if provided, it must match that project.

branch_id

An optional ID of the branch. If not provided the default branch is used.

database_name

For a database-scoped check, the database to inspect. Omit to cover every database on the branch. Ranking and SQL row limits stay per database. One failing database fails the whole run. For a compute-wide check, the database to connect through; the check still runs once for the whole compute and the result does not include `databaseName`. The response `limit` applies to the combined rows after that.

compute_id

The ID of the compute/endpoint. If not provided, the read-write compute associated with the branch will be used.

limit

Maximum number of rows to return from the combined result. Per-database ranking and SQL caps are applied first. The response reports how many rows the check produced and whether they were truncated, so raise this only when `truncated` is true. A few checks are capped in SQL and say so in their description.