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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The project ID (required) | |
| id | Yes | The task assignment ID to update (required) | |
| is_active | No | Update active status | |
| billable | No | Update billable status | |
| hourly_rate | No | Update hourly rate | |
| budget | No | Update budget allocation |
Implementation Reference
- src/tools/projects.ts:155-174 (handler)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'); } } } - src/tools/projects.ts:362-380 (registration)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), }, - src/schemas/task.ts:89-96 (schema)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(),