Search objects by name
pg_searchSearch PostgreSQL database objects by name across tables, columns, functions, indexes, and comments to find where a known term lives; results are grouped by kind and ranked by match type.
Instructions
Find database objects by name: tables, views, columns, functions, indexes, sequences, types, enum labels, triggers, constraints, schemas, extensions, and text inside comments.
Use it when you know a word (invoice, customer_id) but not where it lives. The
answer is grouped by kind, best matches first (exact name, then prefix, then
substring), each as schema.object. query matches anywhere in a name (* and ?
are wildcards). kinds narrows the search, schema limits it to one schema, limit
is the maximum per kind. System schemas are skipped unless named.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "pg_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kinds | No | ||
| limit | No | ||
| query | Yes | ||
| schema | No | ||
| connection | No |