list_clients
Retrieve and filter client lists from Harvest time tracking with pagination, active status, and update date options to manage billing information.
Instructions
Retrieve a list of clients with optional filtering by active status and updated date. Returns paginated results with client details including billing information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| is_active | No | Filter by active status | |
| updated_since | No | Filter by clients updated since this timestamp | |
| page | No | Page number for pagination | |
| per_page | No | Number of clients per page (max 2000) |
Implementation Reference
- src/tools/clients.ts:20-36 (handler)The handler implementation for the list_clients tool.
class ListClientsHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const validatedArgs = validateInput(ClientQuerySchema, args, 'client query'); logger.info('Listing clients from Harvest API'); const clients = await this.config.harvestClient.getClients(validatedArgs); return { content: [{ type: 'text', text: JSON.stringify(clients, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'list_clients'); } } } - src/tools/clients.ts:116-132 (registration)Registration of the list_clients tool within the registerClientTools function.
{ tool: { name: 'list_clients', description: 'Retrieve a list of clients with optional filtering by active status and updated date. Returns paginated results with client details including billing information.', inputSchema: { type: 'object', properties: { is_active: { type: 'boolean', description: 'Filter by active status' }, updated_since: { type: 'string', format: 'date-time', description: 'Filter by clients updated since this timestamp' }, page: { type: 'number', minimum: 1, description: 'Page number for pagination' }, per_page: { type: 'number', minimum: 1, maximum: 2000, description: 'Number of clients per page (max 2000)' }, }, additionalProperties: false, }, }, handler: new ListClientsHandler(config), },