list_users
Retrieve paginated user lists from Harvest with filters for active status and update date. Manage user profiles and permissions efficiently.
Instructions
Retrieve a list of users with optional filtering by active status and updated date. Returns paginated results with user profiles and permissions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| is_active | No | Filter by active status | |
| updated_since | No | Filter by users updated since this timestamp | |
| page | No | Page number for pagination | |
| per_page | No | Number of users per page (max 2000) |
Implementation Reference
- src/tools/users.ts:20-36 (handler)The ListUsersHandler class which implements the tool's execution logic.
class ListUsersHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const validatedArgs = validateInput(UserQuerySchema, args, 'users query'); logger.info('Listing users from Harvest API'); const users = await this.config.harvestClient.getUsers(validatedArgs); return { content: [{ type: 'text', text: JSON.stringify(users, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'list_users'); } } } - src/tools/users.ts:133-149 (registration)The registration of the 'list_users' tool, including its name, description, and input schema.
{ tool: { name: 'list_users', description: 'Retrieve a list of users with optional filtering by active status and updated date. Returns paginated results with user profiles and permissions.', inputSchema: { type: 'object', properties: { is_active: { type: 'boolean', description: 'Filter by active status' }, updated_since: { type: 'string', format: 'date-time', description: 'Filter by users updated since this timestamp' }, page: { type: 'number', minimum: 1, description: 'Page number for pagination' }, per_page: { type: 'number', minimum: 1, maximum: 2000, description: 'Number of users per page (max 2000)' }, }, additionalProperties: false, }, }, handler: new ListUsersHandler(config), },