Skip to content

feat(users): list active staff via user list --staff and list_staff MCP tool - #89

Merged
jernejk merged 1 commit into
mainfrom
feat/user-list-staff
Sep 25, 2026
Merged

jernejk merged 1 commit into
mainfrom
feat/user-list-staff

Conversation

@joshbermanssw

Copy link
Copy Markdown
Member

cc: —
Related PBI: none

TL;DR

An agent can't find who is missing timesheets, because no MCP tool lists employees. And the raw active list is noisy: on the production tenant, 115 "active" accounts are only 52 real staff.
This PR adds tp user list --staff and a matching list_staff MCP tool that return just the people expected to log time. Pair it with check_week to replace the old SSRS "missing timesheets" report.

How

StaffDirectory.ListAsync (start here) is shared by both surfaces. It takes the active dropdown and drops:

  • names starting with zz: retired accounts that were renamed instead of end-dated
  • no category: service, bot and admin logins
  • categories O, OA-E, EXCON, WE: office/admin, contractors, work experience

Reviewer notes

  • One detail read per employee. Neither the dropdown nor GetByIds returns a category, so it reads /api/employees/{empId} for each candidate, 8 at a time. zz accounts are dropped before these reads.
  • The rules are hardcoded. They mirror the tenant's existing report. If another tenant needs different ones, they can move to config then.

Tests

  • Unit: StaffDirectoryTests covers each exclusion rule and checks that zz accounts get no detail read.
  • WireMock: a new catalog case, a parity row (CLI == MCP), and regenerated discovery goldens (19 / 48 tools).
  • Run from source against the production tenant, read-only, as the requester asked:
    • tp user list --staff --limit 0 --json → 52 rows
    • list_staff over tp mcp stdio → 52 rows
  • Not run against ssw-staging.

Changes made by Claude Opus 5.5 via Claude Code.

🤖 Generated with Claude Code

…ff MCP tool

Adds StaffDirectory, the roster a missing-timesheet check runs against:
active employees minus uncategorised, O, OA-E, EXCON and WE accounts, and
retired accounts renamed with a zz prefix.

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

@jernejk jernejk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jernejk
jernejk merged commit 524127e into main Sep 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants