Roles and memberships
pg_rolesList PostgreSQL roles, attributes, memberships, and settings to identify who can log in or holds powerful privileges, with optional name filtering and system-role inclusion.
Instructions
List database roles (users and groups) with their attributes (superuser, createdb,
createrole, login, replication, bypassrls), connection limit, password expiry, the
roles each one belongs to (member_of) and its members, plus per-role settings.
Use it to see who can log in and who holds powerful attributes. Superusers also get
the password method of each login role (scram-sha-256, md5 or none); the hash itself is
never returned. pattern filters by name (* wildcard). Built-in pg_* roles are
hidden unless include_system is true. From PostgreSQL 16 memberships show their
admin/inherit/set options.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "pg_roles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| pattern | No | ||
| connection | No | ||
| include_system | No |