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.

โ†“ Download skill (.md)
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

/
  1. 1
    Download the file s35-get-users-roles-teams.md using the button above.
  2. 2
    Place 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
  3. 3
    Use 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
95/100ยท๐Ÿ” Ad hocยทExpert

MCP coverage audit & gap analysis

Probes all available MCP tools, re-evaluates coverage of 50 persona use cases, detects new fields or tools, and regenerates the gap analysis report.

CFOControllerAP Manager
90/100ยท๐Ÿ“… WeeklyยทBeginner

Card requests via get_requests

Explains how to use get_requests for card requests and why expense reimbursements don't appear there. Avoids a frequent source of confusion between two distinct workflows.

ControllerFinance Analyst
90/100ยท๐Ÿ” Ad hocยทIntermediate

Active vs archived cost centers

Distinguishes active cost centers from archived ones with correct use of get_cost_centers. Avoids the counter-intuitive isArchived vs isActive naming convention pitfall.

ControllerFinance Analyst