query_directory_users
Queries users from a Caspio directory. Directories are tables with authentication and identity capabilities enabled, supporting Caspio-native authentication and SAML-based federation. This tool returns only the directory-designated fields plus three system attributes not available through regular table queries: _status ('Active', 'Inactive', 'ActivationPending', 'ActivationExpired', 'Locked', 'Suspended', 'PasswordExpired'), _sign_in_method (e.g., 'Caspio' or an external SAML provider), and _2fa_status ('Enabled', 'Disabled', 'Unavailable'). These system attributes can be used in SELECT, WHERE, ORDER BY, and GROUP BY clauses. The underlying table may contain additional fields (e.g., photo, date of birth, employment dates) that are only accessible through query_table using that table's Id (from discover_tables). IMPORTANT: field names are case-insensitive and must come from discover_directories' field list -- never guess. Call discover_directories first for any directory not already discovered earlier in this conversation to get its directoryId.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of records returned (skipped when pageNumber or pageSize is not empty, max = 1000, default = 100). | |
| where | No | WHERE clause. Examples: 'YesNoBoolField=1'; 'NumField=123 AND (StrField=N'Abc' OR DateField<='2001-01-31 23:59:59')'; 'Name = N'O''Brien'' (N prefix denotes Unicode, use '' to escape single quotes)' | |
| select | Yes | SELECT field list (required). Use '' to return all fields (safe default). Examples: ''; 'Email, _status'; 'COUNT(*) as Total' | |
| groupBy | No | GROUP BY clause. Use when grouping results by specific fields with aggregate functions. Examples: 'PK_ID', 'Field1, Field2' | |
| orderBy | No | ORDER BY clause. Examples: 'PK_ID', 'Field1 ASC, Field2 DESC' | |
| pageSize | No | Number of records per page (possible values from 5 to 1000, default = 25) | |
| pageNumber | No | Page number (default = 1) | |
| directoryId | Yes | Directory Id (e.g., 'd99357'), obtained from the discover_directories tool call -- the directory's name has no meaning for API calls; only the Id can be used here. | |
| getPaginationInfo | No | Return pagination info (total_count, page_size, page_number) in a 'pagination' object. Default is false. |