Skip to main content
Glama

update_project_task_assignment

Modify project task assignments by updating rates, budget, and active status for Harvest time tracking projects.

Instructions

Update an existing project task assignment including rates, budget, and active status. Only provided fields will be updated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe project ID (required)
idYesThe task assignment ID to update (required)
is_activeNoUpdate active status
billableNoUpdate billable status
hourly_rateNoUpdate hourly rate
budgetNoUpdate budget allocation

Implementation Reference

  • The UpdateProjectTaskAssignmentHandler class implements the logic for executing the update_project_task_assignment tool, including input validation and calling the Harvest API client.
    class UpdateProjectTaskAssignmentHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(UpdateProjectTaskAssignmentSchema, args, 'update project task assignment');
          logger.info('Updating project task assignment via Harvest API', { 
            projectId: validatedArgs.project_id, 
            taskAssignmentId: validatedArgs.id 
          });
          const assignment = await this.config.harvestClient.updateProjectTaskAssignment(validatedArgs.project_id, validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(assignment, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'update_project_task_assignment');
        }
      }
    }
  • The tool registration for update_project_task_assignment within the registerProjectTools function, which maps the name, description, schema, and handler.
      tool: {
        name: 'update_project_task_assignment',
        description: 'Update an existing project task assignment including rates, budget, and active status. Only provided fields will be updated.',
        inputSchema: {
          type: 'object',
          properties: {
            project_id: { type: 'number', description: 'The project ID (required)' },
            id: { type: 'number', description: 'The task assignment ID to update (required)' },
            is_active: { type: 'boolean', description: 'Update active status' },
            billable: { type: 'boolean', description: 'Update billable status' },
            hourly_rate: { type: 'number', minimum: 0, description: 'Update hourly rate' },
            budget: { type: 'number', minimum: 0, description: 'Update budget allocation' },
          },
          required: ['project_id', 'id'],
          additionalProperties: false,
        },
      },
      handler: new UpdateProjectTaskAssignmentHandler(config),
    },
  • Zod schema definition for UpdateProjectTaskAssignmentSchema used for validating inputs to the update_project_task_assignment tool.
    export const UpdateProjectTaskAssignmentSchema = CreateProjectTaskAssignmentSchema.partial().extend({
      project_id: z.number().int().positive(),
      id: z.number().int().positive(),
    });
    
    // Query parameters for listing tasks
    export const TaskQuerySchema = z.object({
      is_active: z.boolean().optional(),

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