list_projects
Retrieve available Harvest projects to select the correct one for time tracking entries, ensuring accurate project assignment and reporting.
Instructions
List available Harvest projects
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:382-397 (handler)The handler for the list_projects tool. Fetches all projects from the Harvest API via GET /projects and returns a JSON string of project details including id, name, code, and active status.case 'list_projects': { const response = await this.axiosInstance.get('/projects'); return { content: [ { type: 'text', text: JSON.stringify(response.data.projects.map((p: { id: number; name: string; code: string; is_active: boolean }) => ({ id: p.id, name: p.name, code: p.code, is_active: p.is_active, })), null, 2), }, ], }; }
- src/index.ts:281-288 (registration)Registration of the list_projects tool in the ListToolsRequestSchema handler, including its name, description, and empty input schema (no parameters required).name: 'list_projects', description: 'List available Harvest projects', inputSchema: { type: 'object', properties: {}, }, }, {
- src/index.ts:284-288 (schema)Input schema for list_projects tool, which is an empty object (no input parameters needed).type: 'object', properties: {}, }, }, {