Skip to main content
Glama

update_user

Modify user profiles, permissions, and billing rates in Harvest time tracking. Update specific fields like name, email, roles, access levels, and rates without affecting unchanged data.

Instructions

Update an existing user's profile, permissions, and rates. Only provided fields will be updated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the user to update (required)
first_nameNoUpdate first name
last_nameNoUpdate last name
emailNoUpdate email address
telephoneNoUpdate phone number
timezoneNoUpdate timezone
has_access_to_all_future_projectsNoUpdate future project access
is_contractorNoUpdate contractor status
is_adminNoUpdate admin privileges
is_project_managerNoUpdate project manager role
can_see_ratesNoUpdate rate visibility
can_create_projectsNoUpdate project creation permission
can_create_invoicesNoUpdate invoice creation permission
is_activeNoUpdate active status
weekly_capacityNoUpdate weekly capacity
default_hourly_rateNoUpdate default hourly rate
cost_rateNoUpdate cost rate

Implementation Reference

  • The UpdateUserHandler class implements the tool logic, validating the input with UpdateUserSchema and calling the harvestClient.updateUser method.
    class UpdateUserHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(UpdateUserSchema, args, 'update user');
          logger.info('Updating user via Harvest API', { userId: validatedArgs.id });
          const user = await this.config.harvestClient.updateUser(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(user, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'update_user');
        }
      }
    }
  • Registration of the 'update_user' tool, including its schema definition and handler instance.
      tool: {
        name: 'update_user',
        description: 'Update an existing user\'s profile, permissions, and rates. Only provided fields will be updated.',
        inputSchema: {
          type: 'object',
          properties: {
            id: { type: 'number', description: 'The ID of the user to update (required)' },
            first_name: { type: 'string', minLength: 1, description: 'Update first name' },
            last_name: { type: 'string', minLength: 1, description: 'Update last name' },
            email: { type: 'string', format: 'email', description: 'Update email address' },
            telephone: { type: 'string', description: 'Update phone number' },
            timezone: { type: 'string', description: 'Update timezone' },
            has_access_to_all_future_projects: { type: 'boolean', description: 'Update future project access' },
            is_contractor: { type: 'boolean', description: 'Update contractor status' },
            is_admin: { type: 'boolean', description: 'Update admin privileges' },
            is_project_manager: { type: 'boolean', description: 'Update project manager role' },
            can_see_rates: { type: 'boolean', description: 'Update rate visibility' },
            can_create_projects: { type: 'boolean', description: 'Update project creation permission' },
            can_create_invoices: { type: 'boolean', description: 'Update invoice creation permission' },
            is_active: { type: 'boolean', description: 'Update active status' },
            weekly_capacity: { type: 'number', minimum: 0, description: 'Update weekly capacity' },
            default_hourly_rate: { type: 'number', minimum: 0, description: 'Update default hourly rate' },
            cost_rate: { type: 'number', minimum: 0, description: 'Update cost rate' },
          },
          required: ['id'],
          additionalProperties: false,
        },
      },
      handler: new UpdateUserHandler(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