harvest_list_clients
Retrieve a list of clients from Harvest with options to filter by active status and control pagination for efficient client management.
Instructions
List all clients with filtering options. Use about {"tool": "harvest_list_clients"} for detailed parameters and examples.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| is_active | No | Filter by active status | |
| page | No | Page number | |
| per_page | No | Results per page (max 100) |
Implementation Reference
- src/index.ts:234-243 (handler)The primary handler for the 'harvest_list_clients' tool in the MCP server. It calls the HarvestClient.getClients method with input arguments and returns the API response as JSON-formatted text content.case 'harvest_list_clients': const clients = await harvestClient.getClients(typedArgs); return { content: [ { type: 'text', text: JSON.stringify(clients, null, 2), }, ], };
- src/tools.ts:167-177 (schema)JSON Schema definition for the harvest_list_clients tool, including name, description, and input parameters for validation.name: 'harvest_list_clients', description: 'List all clients with filtering options. Use about {"tool": "harvest_list_clients"} for detailed parameters and examples.', inputSchema: { type: 'object', properties: { is_active: { type: 'boolean', description: 'Filter by active status' }, page: { type: 'number', description: 'Page number' }, per_page: { type: 'number', description: 'Results per page (max 100)' } } } },
- src/harvest-client.ts:151-154 (helper)Helper method in HarvestClient class that performs the actual API call to list clients, building query string from options (is_active, page, per_page) and using makeRequest for authenticated GET to /clients endpoint.async getClients(options?: any) { const queryString = this.buildQueryString(options); return this.makeRequest(`/clients${queryString}`); }
- src/index.ts:69-73 (registration)Tool registration via the list tools handler, which returns the array of all tool definitions (including harvest_list_clients) from tools.ts.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: tools, }; });