Skip to main content
Glama

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
NameRequiredDescriptionDefault
first_nameYesFirst name (required)
last_nameYesLast name (required)
emailYesEmail address (required)
telephoneNoPhone number
timezoneNoUser timezone
has_access_to_all_future_projectsNoGrant access to all future projects
is_contractorNoMark as contractor
is_adminNoGrant admin privileges
is_project_managerNoGrant project manager role
can_see_ratesNoAllow viewing of billing rates
can_create_projectsNoAllow project creation
can_create_invoicesNoAllow invoice creation
is_activeNoUser active status
weekly_capacityNoWeekly capacity in seconds
default_hourly_rateNoDefault hourly rate
cost_rateNoCost rate for internal calculations

Implementation Reference

  • 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');
        }
      }
    }
  • 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),
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ianaleck/harvest-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server