Skip to main content
Glama

List custom database roles

database_roles_list
Read-onlyIdempotent

List custom database roles with their names, databases, inherited roles, and privileges, using cursor-based pagination to page through results.

Instructions

List custom database roles

Returns custom roles with their name, database, inherited roles and privileges; pass database and name to database_role_get. Pagination defaults to 100 entries (limit 1–500); pass nextCursor as cursor until absent. Role administration uses the database-users RBAC resource.

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>"
    },
    "name": "database_roles_list"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum results per page. Results are authorization-filtered before pagination.
cursorNoOpaque cursor returned by the preceding page.
clusterYesManaged cluster name; the RBAC object is namespace/cluster.
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
nextCursorNoOpaque continuation cursor; absent at the end.
operationIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 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 / cursor / description
      Added value: +"Opaque cursor returned by the preceding page."
    • addedInput schema / properties / limit / description
      Added value: +"Maximum results per page. Results are authorization-filtered before pagination."
    • 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": {
      +    "DatabaseRole_depth15": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "database": {
      +          "maxLength": 128,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "name": {
      +          "maxLength": 128,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "privileges": {
      +          "items": {
      +            "$ref": "#/$defs/Privilege_depth14"
      +          },
      +          "type": "array"
      +        },
      +        "roles": {
      +          "items": {
      +            "$ref": "#/$defs/RoleReference_depth14"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "name",
      +        "database",
      +        "roles",
      +        "privileges"
      +      ],
      +      "type": "object"
      +    },
      +    "PrivilegeResource_depth13": {
      +      "additionalProperties": false,
      +      "description": "MongoDB privilege resource document; cluster/anyResource are mutually exclusive with db/collection.",
      +      "properties": {
      +        "anyResource": {
      +          "type": "boolean"
      +        },
      +        "cluster": {
      +          "type": "boolean"
      +        },
      +        "collection": {
      +          "type": "string"
      +        },
      +        "db": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "Privilege_depth14": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "actions": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "resource": {
      +          "$ref": "#/$defs/PrivilegeResource_depth13"
      +        }
      +      },
      +      "required": [
      +        "resource",
      +        "actions"
      +      ],
      +      "type": "object"
      +    },
      +    "RoleReference_depth14": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "db": {
      +          "type": "string"
      +        },
      +        "role": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "role",
      +        "db"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "additionalProperties": false,
      +  "properties": {
      +    "items": {
      +      "items": {
      +        "$ref": "#/$defs/DatabaseRole_depth15"
      +      },
      +      "type": "array"
      +    },
      +    "nextCursor": {
      +      "description": "Opaque continuation cursor; absent at the end.",
      +      "type": "string"
      +    },
      +    "operationId": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "items"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.4.3

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered; the description adds what is returned (name, database, inherited roles, privileges) and the pagination contract (default 100, limit 1–500, follow nextCursor until absent). The RBAC resource note is useful operational context. It does not mention authorization filtering of results, though the schema does.

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

Conciseness4/5

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

The content is front-loaded and dense: purpose first, then return shape, detail routing, pagination protocol, and RBAC context. The opening clause repeats the title verbatim, and the return-field list partially duplicates the output schema, but overall there is little waste.

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?

For a paginated read-only list tool with full schema coverage and an output schema, the description covers purpose, return shape, pagination iteration, and the sibling to use for detail retrieval. Only the authorization-filtering behavior and the cluster/namespace scoping are left entirely to the schema, which is acceptable given the structured coverage.

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%, so the parameters are already documented; the description restates the limit range and default and explains the cursor loop ('until absent'), which adds a small amount of iteration guidance beyond the opaque-cursor wording. Note the description calls the response cursor 'nextCursor' while the input parameter is named 'cursor', a minor naming mismatch the schema has to disambiguate.

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

Purpose4/5

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

The opening line states a specific verb and resource (list custom database roles) and the body routes single-role lookups to the sibling database_role_get, so the agent can distinguish this list operation from a detail fetch. It does not disambiguate from the other *_roles_list siblings, but the 'custom database roles' framing is specific enough to indicate the database RBAC domain.

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 explicitly says to pass database and name to database_role_get for a single role, giving a clear when-to-use-this-vs-alternative rule, and it states that role administration falls under the database-users RBAC resource, which tells the agent what authorization context applies. It stops short of naming when this tool should NOT be used (e.g. versus postgres/elasticsearch role listings).

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