get_grants
View permissions for Databricks objects like tables, schemas, and catalogs by specifying the object type and full name to check access rights.
Instructions
View object permissions (SHOW GRANTS)
Args: securable_type: Object type (TABLE, SCHEMA, CATALOG, VOLUME, etc.) full_name: Full object name (catalog.schema.table format)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| securable_type | Yes | ||
| full_name | Yes |
Implementation Reference
- tools/delta.py:29-45 (handler)The get_grants tool handler executes the 'SHOW GRANTS' SQL command to retrieve permissions for a specified Unity Catalog object. It includes input validation for the securable type and the object name components.
def get_grants(ctx: Context, securable_type: str, full_name: str) -> List[Dict[str, Any]]: """ View object permissions (SHOW GRANTS) Args: securable_type: Object type (TABLE, SCHEMA, CATALOG, VOLUME, etc.) full_name: Full object name (catalog.schema.table format) """ validated_type = validate_securable_type(securable_type) # Validate and quote full_name parts parts = full_name.split(".") quoted_parts = [] for part in parts: validate_identifier(part, "full_name component") quoted_parts.append(quote_identifier(part)) quoted_full_name = ".".join(quoted_parts) return execute_sql(ctx, f"SHOW GRANTS ON {validated_type} {quoted_full_name}")