Skip to main content
Glama

Who can do what

pg_privileges
Read-onlyIdempotent

Inspect PostgreSQL access rights by object or role: view who can act on tables, schemas, functions, sequences, or databases, plus inherited, PUBLIC, owner, and default privileges.

Instructions

Show access rights, in one of two ways. With object: who can do what on that table (and its columns), schema, function, sequence or database, owner and PUBLIC included. With role: everything that role may do (granted directly, through roles it inherits, or to PUBLIC), the objects it owns and its default privileges.

kind says what object names (default table, views included); a function can be schema.name or name(argument types) when overloaded. Pass role="public" to see what every role can do. Pass one of object and role, not both. A superuser bypasses all of these checks; the answer says so.

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_privileges"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNotable
roleNo
limitNo
objectNo
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover readOnly/idempotent/non-destructive, so the bar is lower; the description adds real substance beyond them, disclosing that results include owners and PUBLIC, that role mode folds in inherited and default privileges, and that a superuser bypasses all checks with the response noting it. It does not describe the `limit` behavior or result shape, which keeps it off a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Structurally front-loaded: mode summary first, then each parameter's meaning, then the mutual-exclusion rule and the superuser caveat. Sentences are dense with information and none reads as filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description partially compensates by hinting at what the answer contains (owner, PUBLIC, inherited grants, superuser note). The remaining gap is truncation behavior via `limit` and how results are grouped, which an agent would otherwise have to discover empirically.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and does: it defines `object`, `role` (including the 'public' sentinel), and `kind` with its default and view inclusion, plus the `schema.name` vs `name(argument types)` disambiguation. Only the generic `limit` and `connection` parameters go unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line 'Show access rights, in one of two ways' states a specific verb and resource, and the two modes (by object, by role) are immediately enumerated. An agent can distinguish this from catalog/listing siblings like pg_list_objects or pg_describe_object without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit mode selection rules: 'Pass one of `object` and `role`, not both', 'Pass `role="public"` to see what every role can do', and '`kind` says what `object` names'. It also clarifies function naming for overloads. It stops short of naming sibling tools, but the within-tool when/when-not guidance is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.