delete_client
Archive a Harvest client to preserve historical project and billing data while removing them from active use.
Instructions
Delete (archive) a client. This action archives the client rather than permanently deleting it, preserving historical project and billing data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client_id | Yes | The ID of the client to delete |
Implementation Reference
- src/tools/clients.ts:94-112 (handler)The DeleteClientHandler class, which implements the ToolHandler interface, processes the request to delete a client via the Harvest API.
class DeleteClientHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const inputSchema = z.object({ client_id: z.number().int().positive() }); const { client_id } = validateInput(inputSchema, args, 'delete client'); logger.info('Deleting client via Harvest API', { clientId: client_id }); await this.config.harvestClient.deleteClient(client_id); return { content: [{ type: 'text', text: JSON.stringify({ message: `Client ${client_id} deleted successfully` }, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'delete_client'); } } } - src/tools/clients.ts:185-199 (registration)The registration of the 'delete_client' tool within the registerClientTools function, associating it with the DeleteClientHandler.
{ tool: { name: 'delete_client', description: 'Delete (archive) a client. This action archives the client rather than permanently deleting it, preserving historical project and billing data.', inputSchema: { type: 'object', properties: { client_id: { type: 'number', description: 'The ID of the client to delete' }, }, required: ['client_id'], additionalProperties: false, }, }, handler: new DeleteClientHandler(config), },