List users (members) with roles and teams
Lists active or archived users with their Spendesk roles and teams. Accounts for result limitations in large companies via pagination.
86/100ยท๐ Ad hocยทBeginnerControllerFinance Analyst
SettingsComplianceget_users
๐ฏ Skill purpose
Lists active or archived users with their Spendesk roles and teams. Accounts for result limitations in large companies via pagination.
๐ What it produces
Member directory with Spendesk role, team membership, and status (active/archived).
โก Benefit
Before
Manual directory export โ no combined roles and teams view in a single query.
After
Instant complete roles + teams directory, with automatic pagination.
# Instructions โ Listing users (members)
## โ ๏ธ Roles and teams not available
`get_users` returns: `id`, `firstName`, `lastName`, `email`, `companyId`
**What is NOT available:**
- Role (admin, controller, employee...)
- Team / department
- Hire or departure date
โ To filter "the admins" or "the managers": not possible via `get_users` alone.
โ Solution: use cost centers or analytical fields as an organizational proxy.
## โ ๏ธ Archived users: firstName and lastName = null
Archived users have neither a first name nor a last name โ only `id` and `email` are present.
```json
// Active user:
{ "id": "...", "firstName": "Alice", "lastName": "Martin", "email": "alice@spendesk.com" }
// Archived user:
{ "id": "...", "firstName": null, "lastName": null, "email": "alice@spendesk.com" }
```
โ Always use `email` as a fallback label if `firstName=null`.
โ Recommended display format: `firstName + lastName || email`
## โ ๏ธ 1200-second cache (20 minutes)
Data can be up to 20 minutes stale.
โ For real-time needs (ongoing onboarding, recent departure), inform the user.
## Step 1 โ List active users
```json
{ "companyId": "...", "status": "active", "pageSize": 100 }
```
Always paginate until `hasNextPage=false` โ this account has more than 10 active users (hasNextPage=true as soon as pageSize=10).
## Step 2 โ Include archived users (historical audit)
```json
{ "companyId": "...", "status": "archived", "pageSize": 100 }
```
Usage: retrieve past expenses of a former employee (by email or userId).
โ ๏ธ `firstName`/`lastName` are null โ display only the email or ID.
## Step 3 โ Resolving a userId into a name
To resolve a `memberId` (from a payable) into an employee name:
1. Call `get_users` (status=active)
2. If not found, call `get_users` (status=archived)
3. Display: `${user.firstName} ${user.lastName}` if not null, otherwise `user.email`
## Step 4 โ Use as a reference for spendesk_analyze_spend
To filter spend by employee:
1. `get_users` โ find the `userId` by first name/email
2. Pass `filters.employeeIds=[userId]` in `spendesk_analyze_spend`
## Live example (real data)
- Active users: > 10 (hasNextPage=true at pageSize=10)
- Archived users: > 5 (hasNextPage=true at pageSize=5)
- Confirmed archived format: `{ firstName: null, lastName: null, email: "nina.mayer@spendesk.com" }`
## Example prompt
- "List all active employees" โ status=active + full pagination
- "Find the expenses of Nina Mayer (former employee)" โ status=archived, filter by email
- "Who has the most expenses in June?" โ get_users + spendesk_analyze_spend groupBy=employee
How to install this skill
/
- 1Download the file
s35-get-users-roles-teams.mdusing the button above. - 2Place the file in the
.claude/directory of your project (or~/.claude/for a global install).cp s35-get-users-roles-teams.md .claude/s35-get-users-roles-teams.md - 3Use in Claude Code โ the skill is automatically discovered. Describe your need in natural language and Claude will apply the skill instructions.
๐ก Make sure the Spendesk MCP is configured in your
.claude/settings.json with the tools get_users.Similar skills
โ
Top