Skip to main content
Glama

List explicit database and schema grants in a database

postgres_grants_list
Read-onlyIdempotent

List explicit database and schema grants for a PostgreSQL database, returning role, optional schema, and privileges to audit access while excluding reserved identities.

Instructions

List explicit database and schema grants in a database

Returns an unpaginated items array containing role, database, optional schema and privileges for the selected target. Reserved identities are excluded; use postgres_roles_list to inspect the grantees.

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": {
      "cluster": "<cluster>",
      "database": "<database>"
    },
    "name": "postgres_grants_list"
  }
}

Input Schema

NameRequiredDescriptionDefault
clusterYesManaged cluster name; the RBAC object is namespace/cluster.
databaseYesExact application database name, 1–63 UTF-8 bytes without control characters; use name from postgres_databases_list.
namespaceNoNamespace of the requested object; defaults to default for single-object routes and creation. On collection routes (/clusters, /operations, /events, /events/stream, /orphaned-volumes, /backup-storages and root /metrics), absence includes all authorized namespaces and a value filters to that namespace. A nonexistent explicit namespace returns 404 not_found with resource namespace and its name only when the authenticated caller has a permission in that namespace. Otherwise collections remain empty and object requests retain their normal 403 response without revealing existence. Public and unauthenticated authentication routes do not resolve the parameter.

Output Schema

NameRequiredDescriptionDefault
itemsYes
operationIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $defs / NamespaceName
      Removed value: -{
      -  "description": "Project namespace name, 2–32 lowercase letters, digits or hyphens; starts with a letter and ends with a letter or digit. The existing default namespace is reserved.",
      -  "maxLength": 32,
      -  "minLength": 2,
      -  "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$",
      -  "type": "string"
      -}
    • addedInput schema / $defs / NamespaceName_depth16
      Added value: +{
      +  "description": "Project namespace name, 2–32 lowercase letters, digits or hyphens; starts with a letter and ends with a letter or digit. The existing default namespace is reserved.",
      +  "maxLength": 32,
      +  "minLength": 2,
      +  "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$",
      +  "type": "string"
      +}
    • addedInput schema / properties / cluster / description
      Added value: +"Managed cluster name; the RBAC object is namespace/cluster."
    • addedInput schema / properties / database / description
      Added value: +"Exact application database name, 1–63 UTF-8 bytes without control characters; use name from postgres_databases_list."
    • changedInput schema / properties / namespace / $ref
      Previous value: -"#/$defs/NamespaceName"New value: +"#/$defs/NamespaceName_depth16"
    • addedInput schema / properties / namespace / description
      Added value: +"Namespace of the requested object; defaults to default for single-object routes and creation. On collection routes (/clusters, /operations, /events, /events/stream, /orphaned-volumes, /backup-storages and root /metrics), absence includes all authorized namespaces and a value filters to that namespace. A nonexistent explicit namespace returns 404 not_found with resource namespace and its name only when the authenticated caller has a permission in that namespace. Otherwise collections remain empty and object requests retain their normal 403 response without revealing existence. Public and unauthenticated authentication routes do not resolve the parameter."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "PostgresGrant_depth16": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "database": {
      +          "maxLength": 63,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "privileges": {
      +          "items": {
      +            "enum": [
      +              "CONNECT",
      +              "CREATE",
      +              "TEMP",
      +              "TEMPORARY",
      +              "USAGE"
      +            ],
      +            "type": "string"
      +          },
      +          "minItems": 1,
      +          "type": "array",
      +          "uniqueItems": true
      +        },
      +        "role": {
      +          "maxLength": 63,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "schema": {
      +          "maxLength": 63,
      +          "minLength": 1,
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "role",
      +        "database",
      +        "privileges"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "properties": {
      +    "items": {
      +      "items": {
      +        "$ref": "#/$defs/PostgresGrant_depth16"
      +      },
      +      "type": "array"
      +    },
      +    "operationId": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "items"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.4.3

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the readOnly/idempotent/non-destructive annotations, the description discloses that results are unpaginated and that reserved identities are filtered out — two behaviors that materially affect how an agent consumes the output. It does not explain permission requirements or ordering.

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?

Two sentences, front-loaded with the purpose and scope, followed by the return shape and the sibling routing. No filler or repetition of the title.

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?

With annotations, a full output schema, and 100% parameter coverage, the remaining burden is small and the description covers unpagination and reserved-identity exclusion. What "explicit" means relative to grants inherited through role membership is left implicit.

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

Parameters3/5

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

Schema description coverage is 100%, with cluster, database, and namespace all documented in the schema itself. The description only adds "for the selected target" and the notion of an optional schema in the result, which is marginal additional meaning.

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 description uses a specific verb and resource ("List explicit database and schema grants in a database") and the qualifier "explicit" scopes it away from inherited grants. Naming postgres_roles_list for grantees further separates it from the closest sibling.

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?

It routes the agent explicitly to postgres_roles_list when grantee identity details are needed, and the required cluster+database target implies the usage context. It does not state exclusions such as when to prefer a role-centric listing, so it stops short of full when/when-not guidance.

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

Deploy Server

Other Tools