list_estimates
Retrieve and filter estimates by client, state, and date ranges from Harvest time tracking. Returns paginated results with detailed estimate information.
Instructions
Retrieve estimates with filtering by client, state, and date ranges. Returns paginated results with estimate details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client_id | No | Filter by client ID | |
| state | No | Filter by estimate state | |
| from | No | Start date for date range filter (YYYY-MM-DD) | |
| to | No | End date for date range filter (YYYY-MM-DD) | |
| updated_since | No | Filter by estimates updated since this timestamp | |
| page | No | Page number for pagination | |
| per_page | No | Number of estimates per page (max 2000) |
Implementation Reference
- src/tools/estimates.ts:20-36 (handler)The class implementation of the ListEstimatesHandler which processes the tool request.
class ListEstimatesHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const validatedArgs = validateInput(EstimateQuerySchema, args, 'estimate query'); logger.info('Listing estimates from Harvest API'); const estimates = await this.config.harvestClient.getEstimates(validatedArgs); return { content: [{ type: 'text', text: JSON.stringify(estimates, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'list_estimates'); } } } - src/tools/estimates.ts:116-135 (registration)The registration of 'list_estimates' within the registerEstimateTools function.
{ tool: { name: 'list_estimates', description: 'Retrieve estimates with filtering by client, state, and date ranges. Returns paginated results with estimate details.', inputSchema: { type: 'object', properties: { client_id: { type: 'number', description: 'Filter by client ID' }, state: { type: 'string', enum: ['draft', 'sent', 'accepted', 'declined'], description: 'Filter by estimate state' }, from: { type: 'string', format: 'date', description: 'Start date for date range filter (YYYY-MM-DD)' }, to: { type: 'string', format: 'date', description: 'End date for date range filter (YYYY-MM-DD)' }, updated_since: { type: 'string', format: 'date-time', description: 'Filter by estimates 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 estimates per page (max 2000)' }, }, additionalProperties: false, }, }, handler: new ListEstimatesHandler(config), },