update_client
Modify client details in Harvest time tracking by updating name, active status, address, or currency for existing clients.
Instructions
Update an existing client. Can modify name, active status, address, and currency. Only provided fields will be updated.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the client to update (required) | |
| name | No | Update client name | |
| is_active | No | Update active status | |
| address | No | Update client address | |
| currency | No | Update currency code |
Implementation Reference
- src/tools/clients.ts:76-92 (handler)The UpdateClientHandler class implements the tool's execution logic by validating input and calling the Harvest API.
class UpdateClientHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const validatedArgs = validateInput(UpdateClientSchema, args, 'update client'); logger.info('Updating client via Harvest API', { clientId: validatedArgs.id }); const client = await this.config.harvestClient.updateClient(validatedArgs); return { content: [{ type: 'text', text: JSON.stringify(client, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'update_client'); } } } - src/tools/clients.ts:167-184 (registration)The 'update_client' tool registration, defining its schema and assigning the UpdateClientHandler.
tool: { name: 'update_client', description: 'Update an existing client. Can modify name, active status, address, and currency. Only provided fields will be updated.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'The ID of the client to update (required)' }, name: { type: 'string', minLength: 1, description: 'Update client name' }, is_active: { type: 'boolean', description: 'Update active status' }, address: { type: 'string', description: 'Update client address' }, currency: { type: 'string', minLength: 3, maxLength: 3, description: 'Update currency code' }, }, required: ['id'], additionalProperties: false, }, }, handler: new UpdateClientHandler(config), },