harvest_list_projects
Retrieve and filter Harvest projects by active status or client ID to manage time tracking data efficiently.
Instructions
List all projects with filtering options. Use about {"tool": "harvest_list_projects"} for detailed parameters and examples.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client_id | No | Filter by client ID | |
| is_active | No | Filter by active status | |
| page | No | Page number | |
| per_page | No | Results per page (max 100) |
Implementation Reference
- src/index.ts:176-185 (handler)Switch case handler that executes the harvest_list_projects tool by calling harvestClient.getProjects(typedArgs) and returning the result as formatted JSON text content.case 'harvest_list_projects': const projects = await harvestClient.getProjects(typedArgs); return { content: [ { type: 'text', text: JSON.stringify(projects, null, 2), }, ], };
- src/tools.ts:104-116 (schema)Tool schema definition including name, description, and inputSchema for parameter validation.{ name: 'harvest_list_projects', description: 'List all projects with filtering options. Use about {"tool": "harvest_list_projects"} for detailed parameters and examples.', inputSchema: { type: 'object', properties: { is_active: { type: 'boolean', description: 'Filter by active status' }, client_id: { type: 'string', description: 'Filter by client ID' }, page: { type: 'number', description: 'Page number' }, per_page: { type: 'number', description: 'Results per page (max 100)' } } } },
- src/harvest-client.ts:117-120 (helper)Core helper method that performs the HTTP request to Harvest API /projects endpoint with query parameters.async getProjects(options?: any) { const queryString = this.buildQueryString(options); return this.makeRequest(`/projects${queryString}`); }
- src/index.ts:69-73 (registration)Registration of tool listing handler that exposes the harvest_list_projects tool (among others) via the tools array from tools.ts.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: tools, }; });