create_user
Add new users to Harvest with customizable roles, permissions, and access controls for team management and project oversight.
Instructions
Create a new user with specified roles and permissions. Supports team member management and access control.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| first_name | Yes | First name (required) | |
| last_name | Yes | Last name (required) | |
| Yes | Email address (required) | ||
| telephone | No | Phone number | |
| timezone | No | User timezone | |
| has_access_to_all_future_projects | No | Grant access to all future projects | |
| is_contractor | No | Mark as contractor | |
| is_admin | No | Grant admin privileges | |
| is_project_manager | No | Grant project manager role | |
| can_see_rates | No | Allow viewing of billing rates | |
| can_create_projects | No | Allow project creation | |
| can_create_invoices | No | Allow invoice creation | |
| is_active | No | User active status | |
| weekly_capacity | No | Weekly capacity in seconds | |
| default_hourly_rate | No | Default hourly rate | |
| cost_rate | No | Cost rate for internal calculations |
Implementation Reference
- src/tools/users.ts:75-91 (handler)The handler class that executes the 'create_user' tool, validating input against CreateUserSchema and calling the Harvest API.
class CreateUserHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const validatedArgs = validateInput(CreateUserSchema, args, 'create user'); logger.info('Creating user via Harvest API'); const user = await this.config.harvestClient.createUser(validatedArgs); return { content: [{ type: 'text', text: JSON.stringify(user, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'create_user'); } } } - src/tools/users.ts:177-206 (registration)Registration of the 'create_user' tool definition and its associated handler.
{ tool: { name: 'create_user', description: 'Create a new user with specified roles and permissions. Supports team member management and access control.', inputSchema: { type: 'object', properties: { first_name: { type: 'string', minLength: 1, description: 'First name (required)' }, last_name: { type: 'string', minLength: 1, description: 'Last name (required)' }, email: { type: 'string', format: 'email', description: 'Email address (required)' }, telephone: { type: 'string', description: 'Phone number' }, timezone: { type: 'string', description: 'User timezone' }, has_access_to_all_future_projects: { type: 'boolean', description: 'Grant access to all future projects' }, is_contractor: { type: 'boolean', description: 'Mark as contractor' }, is_admin: { type: 'boolean', description: 'Grant admin privileges' }, is_project_manager: { type: 'boolean', description: 'Grant project manager role' }, can_see_rates: { type: 'boolean', description: 'Allow viewing of billing rates' }, can_create_projects: { type: 'boolean', description: 'Allow project creation' }, can_create_invoices: { type: 'boolean', description: 'Allow invoice creation' }, is_active: { type: 'boolean', description: 'User active status' }, weekly_capacity: { type: 'number', minimum: 0, description: 'Weekly capacity in seconds' }, default_hourly_rate: { type: 'number', minimum: 0, description: 'Default hourly rate' }, cost_rate: { type: 'number', minimum: 0, description: 'Cost rate for internal calculations' }, }, required: ['first_name', 'last_name', 'email'], additionalProperties: false, }, }, handler: new CreateUserHandler(config), },