list_projects
Retrieve and filter projects from Harvest time tracking with options for client, active status, and update date. Returns paginated results with detailed project information.
Instructions
Retrieve a list of projects with optional filtering by client, active status, and updated date. Returns paginated results with comprehensive project details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| is_active | No | Filter by active status | |
| client_id | No | Filter by client ID | |
| updated_since | No | Filter by projects updated since this timestamp | |
| page | No | Page number for pagination | |
| per_page | No | Number of projects per page (max 2000) |
Implementation Reference
- src/tools/projects.ts:25-41 (handler)The ListProjectsHandler class implements the logic to list projects by calling the Harvest API.
class ListProjectsHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const validatedArgs = validateInput(ProjectQuerySchema, args, 'project query'); logger.info('Listing projects from Harvest API'); const projects = await this.config.harvestClient.getProjects(validatedArgs); return { content: [{ type: 'text', text: JSON.stringify(projects, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'list_projects'); } } } - src/tools/projects.ts:206-223 (registration)The list_projects tool is registered in the registerProjectTools function, including its input schema and handler mapping.
{ tool: { name: 'list_projects', description: 'Retrieve a list of projects with optional filtering by client, active status, and updated date. Returns paginated results with comprehensive project details.', inputSchema: { type: 'object', properties: { is_active: { type: 'boolean', description: 'Filter by active status' }, client_id: { type: 'number', description: 'Filter by client ID' }, updated_since: { type: 'string', format: 'date-time', description: 'Filter by projects 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 projects per page (max 2000)' }, }, additionalProperties: false, }, }, handler: new ListProjectsHandler(config), },