Files
Tom MoorandClaude Opus 5 41616f73cc feat: Filter DSL for users.list (#13456)
* feat: Filter DSL for users.list

Add the structured filter expression language already used by documents.list
and documents.search to users.list, over an allowlist of id, name, email,
role, createdAt, updatedAt, lastActiveAt and suspendedAt.

Supersedes the ad-hoc ids, emails, role and filter parameters, which are now
deprecated and translated into the DSL so a single path builds the query. The
same translation backs the list_users MCP tool, which held a duplicate copy of
the status handling.

Field specs gain an optional value allowlist, so an unknown role is rejected
at the input layer rather than reaching the enum column. Suspended users
remain invisible to non-admins and excluded by default, unless the expression
references suspendedAt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: Collapse the duplicate suspended user predicate

The non-admin invariant and the default exclusion pushed the same clause for
non-admins in the default case. Both rules are now one predicate: suspended
users are visible to admins only, and then only on request.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: Drop the legacy parameters from the list_users MCP tool

The MCP surface has no backwards compatibility burden, so it takes the filter
DSL directly instead of the deprecated role and status parameters. This gives
the model date ranges, OR groups and name matching, which the old enum pair
could not express.

The field allowlist moves next to the other user filter helpers so the REST
schema and the tool share one definition rather than the tools directory
reaching into the routes.

Drops the unreachable Date member of FilterValue. Dates cross the wire as ISO
8601 strings, a Date instance fails every field kind, and zod cannot represent
it in the JSON Schema the MCP tool list is built from.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* revert: Retain legacy role/filter params in the list_users MCP tool for now

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Revert MCP changes

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 10:47:32 -04:00
..